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

Get Information of Solid Bodies from treeview using API

Anonymous

Get Information of Solid Bodies from treeview using API

Anonymous
Not applicable

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

0 Likes
Reply
760 Views
1 Reply
Reply (1)

frederic.vandenplas
Collaborator
Collaborator

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"