Object Visibility of sketches API

Object Visibility of sketches API

lmc.engineering
Advocate Advocate
926 Views
1 Reply
Message 1 of 2

Object Visibility of sketches API

lmc.engineering
Advocate
Advocate

Hi all,

 

I am a bit of a noob when it comes to fully understanding programming, and this is a prime example of a hole in my knowledge:

 

All I want to do is use an iLogic rule to turn off sketch visibility using the Object visibility. I don't need to cycle through all parts to get the sketches and turn off.. I can actually do that already, I just want the override option for automated screenshots.

 

I have tried the following

 

Inventor.ObjectVisibility.Sketches = False

 

AssemblyDocument.ObjectVisibility.Sketches = False (I believe this method to be read only)

 

I can see in Visual studio object browser that this is possible, but my stupidity is stopping me from getting the right line of code..

 

I know this should be simple for someone who can actually program, I just cant get the **** thing to work.

 

Any help is greatly appreciated

 

 

0 Likes
Accepted solutions (1)
927 Views
1 Reply
Reply (1)
Message 2 of 2

frederic.vandenplas
Collaborator
Collaborator
Accepted solution

Hi,

 

This is pretty easy to accomplish

 

(vba code)

 

Sub ChangeViz()

Dim oDoc As Document
Set oDoc = ThisApplication.ActiveDocument

oDoc.ObjectVisibility.Sketches = False


End Sub

 

If you think this answer fullfilled your needs, improved your knowledge or leads to a solution,
please feel free to "kudos"