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 Next Next
but sometimes not everything get unhighlighted.
Solved! Go to Solution.
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.
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.
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled