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

Everything posted by Karl@CP PISTONS

  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.
  15. I had a coworker ask today for help with something strange. He wanted to use MasterCAM to output g-code for our 5 axis UMC750 with a very specific type of output. He wants to use the C and Z axis only to cut a sphere. He in essence wants the mill to act like a lathe in that the B axis will be positioned at 90 degrees then the C-axis rotate 360 degrees and then move the X and Z and repeat. Is this even possible or would the c axis need to unwind? If possible what type of toolpath would I use to cut like this? Any pointers would be appreciated.
  16. Verify has the option. It's in the verify tab in the Analyze toolbar. Not sure about the stock model though.
  17. Zaffin, the programs are written in VB.net and yes it is a release version of the .DLL C++, I am putting the custom .DLL and .FT files into the "standard" c-hook folder along with all the mastercam supplied programs. I didn't even know that they could be placed anywhere else. Can the .FT files also be located in this "custom" folder also? But still no luck. On my computer I set up a custom tab with the programs I have written. single click and program displays form with no issue. Other computers I never see the form or any errors just nothing. Any other sugestions?
  18. Hello All, I have written half a dozen or so C-Hooks using Visual Studio 2017 and the work great on my computer. Problem arises when my co-workers try to run them. I have placed the .FT file and the .DLL in the correct local directory on each machine but when ran I get nothing. Ne errors just nothing. Anybody have any clues as to where I can start debugging this issue? TIA Karl
  19. Thanks, for the additional info I was forgetting Josh C. That was exactly what fixed the issue. Now on to post fixing to output the correct codes for our formboring takisawa.
  20. Hi All, I am having a brain fade as to how to set up this custom tool for our lathe. I need it to compensate for both sides of the tool to cut the radius correctly. To make it work I've made two custom tools with the tool center set for the center of each left and right radius. Then I'll do the right half of the profile with tool #1 ending at the center then start in the center and cut the left half with tool #2. I'd like to see if I can do this with 1 toolpath / tool to minimize all the hand edits in the actual g-code file. Any suggestions would be greatly appreciated. Karl
  21. What functionality does MC4SW have using API's? I saw that c-hooks are not supported so that for us is a big obstacle. Our shop we have automated about 80% of the "normal" jobs that come thru the door using CamWorks. Camworks got the nod over MasterCAM because of 1) The awesome API that camworks has. We can and do control every aspect of the program automagicly , and 2) MC4SW was in it's infancy when the decision was made. Since camworks has embedded it's self into our company it's would take a lot of persuasion and effort but i'd really like to kick camworks to the curb.
  22. Use the raster to vector c-hook supplied with mastercam.
  23. This place is the best. Thanks for all the help. All fixed and looking good.

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...