Showing results for 
Search instead for 
Do you mean 
Reply

Get tool from operation

Hello,

 

(NX CAM) 

 

How can I get the relevant tool from an opeartion?

 

Thanks,

Tom.

4 REPLIES

Re: Get tool from operation

Hello

 

Try this:

NXOpen.CAM.CAMObject camObject = (NXOpen.CAM.CAMObject)(NXObjectManager.Get(camObjectTag));
if (camObject is NXOpen.CAM.Operation)
{
                NXOpen.CAM.Operation op = (NXOpen.CAM.Operation)camObject;
                NXOpen.CAM.CAMObject tool = op.GetParent(NXOpen.CAM.CAMSetup.View.MachineTool);
}

 

Marek Pawlus, NCmatic

Production: NX 11.0.1
Development: C#, Tcl/Tk, CSE

Re: Get tool from operation

Thank you!

 

And one more question - Is there a way to run on all the tools in the file (like I can run on the operations)?

Re: Get tool from operation

Check out this OOTB sample:

(...)\UGOPEN\SampleNXOpenApplications\.NET\CAM\MCSSetFixtOffset1CycleAll.vb

So you can get an idea how to cycle objects in other ONT views...

 

' ===========================================================================
'   DESCRIPTION
        ' Change the default value for fixture offset from 0 to 1.
		' 
		' This program will cycle through all MILL orient and TURN orient 
		' geometry groups in the part, and if fixture offset is 0, set to 1.
		'
		' This change was applied to all template parts in NX 8.5.
' ============================================================================

 

Marek Pawlus, NCmatic

Production: NX 11.0.1
Development: C#, Tcl/Tk, CSE

Re: Get tool from operation

Here is anothere way to get the tool parent:

Dim ToolGroup as NCGroup = myOp.GetParent(CAMSetup.View.MachineTool)
Dim GroupName as String = ToolGroup.Name 

Attached is a sample vb program that will cycle all tools in the tool view.

 

Mark Rief
Retired Siemens