Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
759 Views, 1 Reply

Get Information of Solid Bodies from treeview using API

Hi everyone,

 

Is it possible get the information of Solid Bodies(2):

1. Solid1:  (Boss- Extrude1)

2. Solid2: (Boss- Extrude2)

from tree view  marked in red in below image using API?

 

キャプチャ.JPG

Please suggest me .

Regards

frederic.vandenplas
in reply to: Anonymous

Hi,

 

This code shows the displayed name of the solid (vba)

Public Sub GetSolidInformation()
    Dim oDoc As PartDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    Dim oDef As ComponentDefinition
    Set oDef = oDoc.ComponentDefinition
    
    Dim oSurfBody As SurfaceBody
    For Each oSurfBody In oDef.SurfaceBodies
        MsgBox (oSurfBody.Name)
    Next oSurfBody
End Sub
If you think this answer fullfilled your needs, improved your knowledge or leads to a solution,
please feel free to "kudos"