Community
Hi Everybody i need some help ho to get the name of a body nested in another body
with this script i get only the "parent" body and not the one nested inside
Dim oCompDef as ComponentDefinition oCompDef = ThisDoc.Document.ComponentDefinition 'define the solidbody Dim oBody As SurfaceBody Dim i As Integer i = 1 For Each SurfaceBody In oCompDef.SurfaceBodies oBody = oCompDef.SurfaceBodies.Item(i) MsgBox(oBody.Name) i = i +1 Next
Solved! Go to Solution.
Solved by TomaszDabrowski. Go to Solution.
I am not sure, but I think it is not a body inside a body, but rather a feature used to create this body.
You can try with:
Dim oCompDef As ComponentDefinition
oCompDef = ThisDoc.Document.ComponentDefinition
'define the solidbody
Dim oBody As SurfaceBody
Dim i As Integer
i = 1
For Each SurfaceBody In oCompDef.SurfaceBodies
oBody = oCompDef.SurfaceBodies.Item(i)
MsgBox(oBody.CreatedByFeature.Name)
i = i +1
Next