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:

NC filename options


Müřlıń®
 Share

Recommended Posts

6 hours ago, Müřlıń® said:

Would be cool if we had a C-hook that did it.

Murlin,

if you can provide me with the details of the functionality you are looking for, I can provide you with such a chook.

 

You want to rename all the operations in a toolpath group to the toolpath groups name?

Link to comment
Share on other sites

To do the Operation name, there is functionality in the NET-Hook API.

namespace - Mastercam.Operations
class - OperationsManager
method ->
/// <summary> Sets the program name in the operations. </summary>
///
/// <param name="name"> The name to assign to the operations. </param>
/// <param name="all">  True to process all operations. False to process just the selected operations. </param>
///
/// <returns> The number of operation that were altered. </returns>
int SetProgramName (String name, bool all);

Link to comment
Share on other sites
13 minutes ago, Roger Martin from CNC Software said:

To do the Operation name, there is functionality in the NET-Hook API.

namespace - Mastercam.Operations
class - OperationsManager
method ->
/// <summary> Sets the program name in the operations. </summary>
///
/// <param name="name"> The name to assign to the operations. </param>
/// <param name="all">  True to process all operations. False to process just the selected operations. </param>
///
/// <returns> The number of operation that were altered. </returns>
int SetProgramName (String name, bool all);

Roger, 

That's neat, so we would need a function to 1.select all the operations by toolpath group

2.store the toolpath group name

3.set the selected ops name

4.next group

I believe there is an overload on one of the groupmanager functions to get the toolpath group

Link to comment
Share on other sites

This seems to work okay.

#r"C:/Program Files/Mcam2021/NETHook3_0.dll"
try
{
var grplist =new System.Collections.Generic.List<Mastercam.Support.Group>();
var ops = Mastercam.Support.SearchManager.GetOperations();
Mastercam.Support.GroupManager.GetAllGroups(grplist,false);

foreach(var group in grplist)
{
foreach(var operation in ops)
{
operation.SetSelectedState(false);
}

foreach(var operation in ops)
{
if(group.ID == operation.GroupNumber)
{
operation.SetSelectedState(true);
}
}

Mastercam.Operations.OperationsManager.SetProgramName(group.Name, false);

}
}
catch(System.Exception e)
{
}

 

Link to comment
Share on other sites
On 2/13/2021 at 10:43 AM, Thee Byte™ said:

You want to rename all the operations in a toolpath group to the toolpath groups name?

Yes...I have had to copy / paste a group of 50 operations and have to make subtitle changes to the toolpaths and rename them into 200 unique ops.

 

So I renamed all the toolpath groups to have a unique name that the customer wants the NC file to be named because he uses a barcode system to

pull these programs to the machine with a certain NC program name.

Much easier to copy/paste than create new tool groups .

Link to comment
Share on other sites
4 minutes ago, Müřlıń® said:

Yes...I have had to copy / paste a group of 50 operations and have to make subtitle changes to the toolpaths and rename them into 200 unique ops.

 

So I renamed all the toolpath groups to have a unique name that the customer wants the NC file to be named because he uses a barcode system to

pull these programs to the machine with a certain NC program name.

Much easier to copy/paste than create new tool groups .

 

4 hours ago, Thee Byte™ said:

The attached nethook should do what you want,..

Link to comment
Share on other sites
  • 2 weeks later...

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

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

 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

×