Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
jgomis.ext
337 Views, 4 Replies

Turn of the visibility of a solid body in a drawing view with iLogic

Hi everybody !

I would like to acces the visibility command that we have for the solid body in a view.

jgomisext_0-1675688865771.png

I have wrote a code to do it with iLogic but it's not working well. My code change the visibility in my part and not only in the model tree of my view.

Dim oDoc As DrawingDocument 
oDoc = ThisApplication.ActiveDocument

Dim oSheet As Sheet
oSheet = ThisDoc.Document.ActiveSheet

Dim oView As DrawingView 
oView = oSheet.DrawingViews(1)

Dim oRefDoc As Document 
oRefDoc = oView.ReferencedDocumentDescriptor.ReferencedDocument 

Dim oCompDef As PartComponentDefinition
oCompDef = oRefDoc.ComponentDefinition

Dim oSB1 As SurfaceBody 
oSB1 = oCompDef.SurfaceBodies(2)

oSB1.Visible = True

Do someone know what I'm doing wrong ?

Thanks for anyhelp ! :slightly_smiling_face: