Showing results for 
Search instead for 
Do you mean 
Solved! Go to solution

Unhighlight all highlighted object/features

How can I unhighlight all highlighted object/features?  Right now I have to loop with something like this


        For Each solidBody As Snap.NX.Body In Snap.Globals.WorkPart.Bodies
            solidBody.IsHighlighted = False
            For Each faceBody As Snap.NX.Face In solidBody.Faces
                faceBody.IsHighlighted = False

but sometimes not everything get unhighlighted.




Re: Unhighlight all highlighted object/features

The Snap.Globals.WorkPart.Bodies collection only includes bodies that truly reside in the work part.It does not include bodies that are occurences of bodies residing in other part files. All object collections in SNAP (and in NX/Open) work this way. 


To get occurences, you have to cycle through the Snap.Globals.WorkPart.Objects collection.


If you find objects that are not occurences, and they are not being unhighlighted by your code, then maybe you have found a bug. Please submit a PR, so that the problem can be investigated.

Accepted by topic author ulink2rle
‎03-06-2017 01:26 PM

Re: Unhighlight all highlighted object/features

You you could use the VB code that does part cleanup?

Record a journal of

File -> Utilities -> Part cleanup -> "Remove extraneuos highlighting"

and adapt to your application


That way it doesn't matter the object type or whatever.

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: Unhighlight all highlighted object/features

[ Edited ]

This is perfect - very fast. Thanks!!!

Re: Unhighlight all highlighted object/features

Thanks, @Yamada