cancel
Showing results for 
Search instead for 
Did you mean: 

Unhighlight all highlighted object/features

Valued Contributor
Valued Contributor

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.

 

 

4 REPLIES

Re: Unhighlight all highlighted object/features

Siemens Phenom Siemens Phenom
Siemens Phenom

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.

山田
yamada

Re: Unhighlight all highlighted object/features

Esteemed Contributor
Esteemed Contributor

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

Valued Contributor
Valued Contributor

This is perfect - very fast. Thanks!!!

Re: Unhighlight all highlighted object/features

Valued Contributor
Valued Contributor

Thanks, @Yamada