cancel
Showing results for 
Search instead for 
Did you mean: 

How to programatically select a part in NX

Solution Partner Pioneer Solution Partner Pioneer
Solution Partner Pioneer

How do I set a programically set a part in NX part navigator as selected?

I am NOT in a dialog so I have no SelectionHandle.

 

Journally does not log such activity

9 REPLIES

Re: How to programatically select a part in NX

Esteemed Contributor
Esteemed Contributor

There is no way to interact with the navigators through NXOpen API.

The BasePart namespace has the the methods to open parts.

The parts collection of the session object allows you to switch between them.

NXOpen API is not  a macro language, it is fully blown .NET or Java.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: How to programatically select a part in NX

Solution Partner Pioneer Solution Partner Pioneer
Solution Partner Pioneer

Ok thanks.

Bad news, but at least I know to stop looking.

Re: How to programatically select a part in NX

Esteemed Contributor
Esteemed Contributor

May be you can use the highlight method of the part object and see if it also gets highlighted in the navigator.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: How to programatically select a part in NX

Solution Partner Pioneer Solution Partner Pioneer
Solution Partner Pioneer

Thanks, buy hightlight only does highlight.  The component looks selected, but is not.

Re: How to programatically select a part in NX

Esteemed Contributor
Esteemed Contributor

In CAM (for the ONT) there is a "theUfSession.UiOnt.AskSelectedNodes"

Does the equivalent exist for the ANT or PNT? (It doesn't look like it, but maybe I'm mising something)

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Re: How to programatically select a part in NX

Esteemed Contributor
Esteemed Contributor

ONT and MNT are the only navigators consisting of multiple views.

ANT and PNT are only consisting of one single view, so there is no additional method besides the one provided by the regular selection manager.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: How to programatically select a part in NX

Valued Contributor
Valued Contributor

I have figured out hundreds of command the following way (albeit in Solidworks):

 

Try recording a short Macro where you manually perform the action you need, save it, and have a look at the code. It might be messy, devious code, but if the macro works after recording, the command you need has to be in there somewhere.

 

Let me know if this works for you,

 

Thomas Musters, Virtual Reality development for Design & Engineering, ASML


Production: {NX9, VisMockup, Unity}

Development: {C#, Java, VB} Testing: {-none-}

Re: How to programatically select a part in NX

Solution Partner Pioneer Solution Partner Pioneer
Solution Partner Pioneer

Thanks, but that doesn't work in this case.

Select does not write to the journal

Re: How to programatically select a part in NX

Valued Contributor
Valued Contributor

Maybe selecting it in the scene itself brings up a command you can use?

Just guessing here, sorry

 

Kind regards,

 

Thomas Musters, Virtual Reality development for Design & Engineering, ASML


Production: {NX9, VisMockup, Unity}

Development: {C#, Java, VB} Testing: {-none-}