The problem occurred when using api to change the name of the tool path

Anonymous

The problem occurred when using api to change the name of the tool path

Anonymous
Not applicable

HI ! I use api to write a program to change the toolpath name,but it returns an error

 

The code is as follows:

private void button1_Click(object sender, EventArgs e)
{
PMAutomation powerMill = new PMAutomation(Autodesk.ProductInterface.InstanceReuse.UseExistingInstance);

PMProject session = powerMill.ActiveProject;

powerMill.DialogsOff();

int row = (int)rowChooser.Value;


foreach (PMToolpath toolpath in session.Toolpaths)
{
toolpath.Name = "O" + row;
row += 1;
toolpath.IsActive = false;
}
}

 

The error is as follows

P2.PNG

 

 

 

 

 

It 

 

It seems that it is because the pattern conversion toolpath 

P3.PNG

 

 

 

how can I fix the error?

Thanks and Best Regards!
Chris Yu

0 Likes
Reply
Accepted solutions (1)
820 Views
3 Replies
Replies (3)

luke.edwards.autodesk
Community Manager
Community Manager
Accepted solution

Hi

Please make sure you are using the latest version of the API.  It now supports that type of toolpath.

Luke


Luke Edwards
Consulting Services Manager
0 Likes

Anonymous
Not applicable

I solved this problem with the latest version, thank you very much

0 Likes

Anonymous
Not applicable

Hi!Luke

Sorry, when I want to add the toolpath name to the listbox, the addition sequence is wrong, the code is as follows

p6.png

Display as follows

P4.PNG

How to fix this error?

thank you very much!

0 Likes