Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

body inside body

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Michele_DeLucaSW7PJ
126 Views, 2 Replies

body inside body

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

 

Cattura.PNG 

Tags (2)
2 REPLIES 2
Message 2 of 3

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

 

Message 3 of 3

It works, thank you!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report