Object Visibility

Object Visibility

engilic
Advocate Advocate
882 Views
2 Replies
Message 1 of 3

Object Visibility

engilic
Advocate
Advocate

Hi,

1. Is it possible to capture the state of checkboxes and then decide whether to do the Command Manager command or not, since it just goes alternately between on and off?

engilic_0-1667440451374.png

 

2. Is it possible to control them through objects not just through Command Manager?

3. Is it possible to control features that are within All Workfeatures separately, not just by turning all of them on or off?

 

This post is good as a partial solution but I do not know which one to apply since I do not know which one is on:

https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/turning-off-object-visibility-all-wo...

Just want to capture users settings regarding Object Visibility, do the changes, do the job, and give back the original settings to the user (shouldn't every code do that unless you want permanent changes?).

Thank you

0 Likes
Accepted solutions (1)
883 Views
2 Replies
Replies (2)
Message 2 of 3

engilic
Advocate
Advocate
Message 3 of 3

JelteDeJong
Mentor
Mentor
Accepted solution

I did not know about this function but it works better than my other solution.

        Dim doc As AssemblyDocument = ThisDoc.Document
        Dim vis = doc.ObjectVisibility

        If (vis.AllWorkFeatures) Then
            vis.AllWorkFeatures = False
            vis.ConstructionSurfaces = False
            vis.Sketches = False
            vis.Sketches3D = False
            vis.SketchDimensions = False
            vis.Annotations3D = False
            vis.ComponentAnnotations3D = False
            vis.Welds = False
            vis.WeldmentSymbols = False
        Else
            vis.AllWorkFeatures = True
            vis.ConstructionSurfaces = True
            vis.Sketches = True
            vis.Sketches3D = True
            vis.SketchDimensions = True
            vis.Annotations3D = True
            vis.ComponentAnnotations3D = True
            vis.Welds = True
            vis.WeldmentSymbols = True
        End If

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com