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:

Has anyone set all NC filename = Toopath Group name?


Recommended Posts

We have the option to set the toolpath group and the .nci file  = (machine name + delimiter + increment) or (filename + delimiter + increment) via the config settings. What about when we import a load of operations from a similar part and then manually rename the toolpath group and then the nci file for several toolpath groups, couldn't the computer do this for us? The functionality is nearly built in already. It would be awesome if we could overwrite the toolpath group names (name + delimiter + increment) and make the nci (and nc) filenames follow suite. Is the ability already there and I'm missing it? Has anyone written a hook for this? If not, how would a fella begin with this C-Hook stuff?

Link to comment
Share on other sites

Attached is an example NET-Hook project that shows how to rename tool path groups and nci name.

 

Basically, run the NET-Hook, use the current drawing or prompt for one if there is none, prompt for a name, rename all tool path groups with the name and set the nci for each operation using the same name. 

 

Hope-fully this will help. If you are interested in writing your own NET-Hooks go to mastercam.com 3rd Party Developers section and down load the appropriate getting stated guide.

 

Source attached and NET-Hook attached.

 

NOTE 1: Extract NET-Hook to a temp folder before copying to Mastercam or it will be blocked.

 

NOTE 2: Not all operation types are support in the .NET API

 

 

Run NET-Hook - RenameToolGroups.dll

nethook_zpsx882sfca.png

 

Select Drawing

drawing_zpseski3fvt.png

 

 

Name prompt

FilenamePrompt_zpsudtel7mj.png

 

Result

Result_zpsdbyscugy.png

 

Post

NC_zpso4kmqh4b.png

 

 

Code - Main Entry Point

run_zpsruyrumuf.png

 

Set Name

SetName_zps9xyanfdo.png

 

Check drawing

getdrawing_zpsvjdww5jz.png

 

Get Groups

getgroups_zps1zec2aui.png

Source_RenameToolGroups.zip

NET-Hook.zip

  • Like 1
Link to comment
Share on other sites
  • 3 weeks later...

Mick,

 

I finally got to sit down and play with this net-hook today. It's great, man! I threw most of the 2D and 3D toolpaths at this thing (all the paths I would use + a few more) and overall it did really well. We don't do multi-axis, so I was unable to test those toolpaths. I haven't scoured every detail to see that the operations were perfectly preserved, but from what I checked today the only loss that I saw was the containment boundary chains for a few 3D toolpaths (the surface geometry was still associated). For those affected 3D toolpaths, all I had to do was re-pick the containment chain and regen. I'm really happy with it.

 

RenameToolGroups.dll is set as my default add-in (:

 

I made a couple of minor edits (may be handy notes for other noobs like myself who download it):

  • First, took the regen foreach loop out of the toolpath naming foreach loop so that operations would only be regenerated once. I believe that was the original intent anyway.
  • Then decided to comment out the regen loop to allow the user to regen at will (only dirty operations, only one group, whatever).
  • Changed `toolpathGroup.Name = result + counter++`   to   `toolpathGroup.Name = result + (1 + counter++).ToString()` so the first group will be number 1.
  • Commented out `FileManager.Save()` to allow the user to save at will.

 

By the way, this was my first little poke at C# that wasn't a read-only exercise. Today is a good day. It was really cool to learn that Mastercam can be launched from the Visual Studio debugger, too. ...first time I've done anything like that. For anyone else reading along, you don't have to connect the debugger to try it out, but it is neat to see it in action. It is like a whole new nerd drug if you've never done it before. Instructions are in the ReadMeFirst part of the project.

 

 

Thanks again, Mick. I'm looking forward to using this at work!

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

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