Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Karl@CP PISTONS

Verified Members
  • Posts

    300
  • Joined

  • Last visited

  • Days Won

    1

Karl@CP PISTONS last won the day on December 22 2020

Karl@CP PISTONS had the most liked content!

About Karl@CP PISTONS

  • Birthday 01/29/1966

Recent Profile Visitors

1,926 profile views

Karl@CP PISTONS's Achievements

Newbie

Newbie (1/14)

49

Reputation

  1. Thank you. That was what I was looking for. I got this to work: For Each Entity As Mastercam.Database.CurveGeometry In Mastercam.Database.ChainManager.GetGeometryInChain(chain(0)) Entity.Color = 31 '// Light Green Entity.Level = 20 Entity.LineWidth = 4 Entity.Commit() Next But that brought up anpther question as to how to determine if there was actually a valid chain. Your solution answerd that even before I asked. Thank you again very much appreciated.
  2. Hello all, I have a need to cycle thru all the entities in a selected chain and change the color and level of each. I have a valid chain and now need to iterate thru each entity in said chain. Here is what I have Dim chain As Mastercam.Database.Chain() Dim Count As Integer chain = GetChain("Select the CENTER containment chain.") Count = chain(0).CurvesCount If (chain.Any()) Then '// set color, level and line width of each For Each Entity As Mastercam.Database.Geometry In chain() Entity.Color = 31 '// Light Green Entity.Level = 20 Entity.LineWidth = 4 Next End If Private Function GetChain(Prompt As String) As Mastercam.Database.Chain() '// select the chain for the organize routine Call ClearGeometry() GetChain = ChainManager.GetMultipleChains(Prompt, False) End Function I have a valid chain as the .CurvesCount returns the correct number of entities, but I get an error on the for each line stating that "Value type 'chain' cannot be converted to type 'geometry' Thanks in advance
  3. Hello all, After a computer crash I am being requested to recreate a net-hook to allow user to select a line from the MasterCAM display area. I have everything set up the way I want it but now I can not get the program to allow user to select the lines. The code looks like this: Module Selection_Tools Friend Function AskForLineGeometry(SelectionNumber As Integer, Total As Integer) As LineGeometry '// Ask user to select a mastercam line Dim Message As String Dim Mask As GeometryMask Message = "Select Line # " & SelectionNumber & " of " & Total Mask = New GeometryMask(False, True, False, False, False, False, False, False) Return AskUser(Message, Mask) End Function End Module In the Main Run command I initialize the Selection_Tools module and the actual call looks like this: Dim Line As Mastercam.Curves.LineGeometry For i = 1 To TotalLines Me.Hide() Line = Selection_Tools.AskForLineGeometry(i, TotalLines) LineLength = Mastercam.Math.VectorManager.Distance(Line.EndPoint1, Line.EndPoint2) Next When ran I get the user prompt i.e. Select line 1 of 10 but the mouse will not allow any geometry to be selected. If I click on the select prompt I can <esc> thru the for look but nothing can be selected on the screen. Any help on this would be greatly appriciated as I spent alot of time this weekend head scratching and I do not have much hair left to scratch out
  4. You can also have a VB Script run using the same idea for each user.
  5. Thanks for all the info. When I grabbed the dll file from the folder that actually had the resource file it all worked. Do you know any good books that would help me as self taught to learn these kinds of issues?
  6. So this is a vs studio issue then? If so how can I rearrange the file structure. Here is how it is now.
  7. It is a nethook created by visual studio 2017 and VB. Here is what is in the resource folder, notice it is in the Function Table folder and not in just the resources folder. Does that matter? Sorry for the many questions as this resource stuff is really not clear to me. Do I just correct the FT file to use NETHook.resx? Or am I not embedding it correctly ? or?
  8. I am struggling to figure out what is happening inside my FT file for my C-Hook. The c-hook builds and program runs fine without the FT file, but if I add the FT file to the chook folder I get an error when mastercam starts. I have attached pictures of the FT file and the mastercam error as I do not know how to imbed the pics into the post. Thanks in advance. Karl S
  9. Thanks that worked like a charm. Now reports back the line length just like I wanted.
  10. Hello All, I am creating a program that I need to report the length of a series of lines. I am using the SelectionManagerExample as a test bed. I have it working for line selection as evidenced by the output of this: Dim line = UtilityService.AskForLineGeometry() DialogManager.OK(CType(IIf(Not line Is Nothing, ApplicationStrings.SelectedLine, ApplicationStrings.NothingSelected), String), ApplicationStrings.SelectALine) Dim Level As Integer Level = line.Level MsgBox("Level of the selected Line is " & Level, vbOKOnly) - Reports the correct level here proving I have a valid line and the UtilityService.AskForLineGeometry is this: Friend Function AskForLineGeometry() As LineGeometry ' Cast the return Geometry type to an explicit LineGeometry, this is fine because we are masking on Line only Return TryCast(AskUser(ApplicationStrings.SelectALine, New GeometryMask(False, True, False, False, False, False, False, False)), LineGeometry) End Function Looking at the Net-Hook API ref I see LineLength property in the index but it looks as if it is ONLY for the LeadInOutEntryExitParams. LineLength Is there an easy way to report back the actual length of the selected line? Seems that there is spline.length and not a line.length
  11. You could also use the keyboard to lock the selection. For instance the P key will select only points C for center I for intersection etc... Only drawback is you have to press the key each time before a selection. so for a series of points it would be P then click, P then click......
  12. No the c-hooks still do nothing even though the FT and DLL files are in the c-hook folder. I have one of our IT guys looking at it but for them it is VERRRRRYYYY low priority. Files are not blocked by windows. Next step for me is to install VS Studio on one of the offending machines and compile the source code to see if it then works. Thanks for asking I'll keep this thread informed if I find any breakthroughs. I was off on Friday and Monday so I'm really backed up so probably won't get to it until Thursday.
  13. cncappsjames, Any spherical shape starting with a simple cylinder aligned with the z axis would get me started. I was thinking of a something like a golf ball on a tee. I'd just like to have any example that I could open with MC2020 and dissect it. Thanks Karl
  14. Thanks for the inputs Leon82 I'll give them a try. Yes cncappsjames I'd like to see if the code is something that he would like. P.S. I've met you James many years ago at Westec at the mastercam booth. Can't recall how many years ago but it was quite a few. Is nice to put a face to a real person.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...