cancel
Showing results for 
Search instead for 
Did you mean: 

How to apply toolpath changes to other operation instances?

Creator
Creator

Hey,

 

I am developing a plugin for CAM using C#. In a prt file with CAM, an operation has multiple transformed instances. When the toolpath of the operation or one of the instances is modified externaly by the program, how can these changes be also applied to other instances?

 

For this case, I can get all instances for the operations by using

Operation[] instances = currentOperation.GetOtherInstances();

but how can I get the instance operations' tranformation matrix, shown below which can be gotten by right-click the instance -> information?

--------- Instance Operations ----------
BLADE_FINISH-1
BLADE_FINISH-3
 
------- Transformation Matrix ------
 
X-axis Vector        XC =    0.955572806          X =    0.955572806      
                     YC =   -0.294755174          Y =   -0.294755174      
                     ZC =    0.000000000          Z =    0.000000000      
 
Y-axis Vector        XC =    0.294755174          X =    0.294755174      
                     YC =    0.955572806          Y =    0.955572806      
                     ZC =    0.000000000          Z =    0.000000000      
 
Z-axis Vector        XC =    0.000000000          X =    0.000000000      
                     YC =    0.000000000          Y =    0.000000000      
                     ZC =    1.000000000          Z =    1.000000000      
Translation Vector   I  =    0.000000000      
                     J  =    0.000000000      
                     K  =    0.000000000      
Scaling Factor       =       1.000000000

 

NX 10.0.3

2 REPLIES

Re: How to apply toolpath changes to other operation instances?

Genius
Genius

Hi Reilley!

 

I hope I understood your question correct:

You want to get the information (e.g. the Transformation Matrix) of an operation

which will be listed in the so-called ListingWindow after right-clicking Operation -> Information.

 

You can do a little dirty 'hack' on that:

 

First thing to know is, that you can display the information of an operation:

 

Session curSession = Session.GetSession();
curSession.Information.DisplayCamObjectsDetails(...);

 

Next step is to pipe the output of the ListingWindow:

ListingWindow curListingWindow = curSession.ListingWindow;
currentPath = YOURPATH (where you want the output pipe to)
curListingWindow.SelectDevice(ListingWindow.DeviceType.File, currentPath)

Now you have to implement some RegularExpression-Checker and find the line with "Transformation Matrix" and read the matrix...

 

To be honest, this is a lousy hack, but it works to extract some informations from the ListingWindow.

Hope that helps! :-)

 

 

Flo

 

Re: How to apply toolpath changes to other operation instances?

Creator
Creator
Thanks, Flo.