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: 

VBA - get Assembly Moments of Inertia

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
gerrardhickson
289 Views, 2 Replies

VBA - get Assembly Moments of Inertia

Hi All,

 

Is there an equivalent for the function below for Assemblies?

oPart.ComponentDefinition.MassProperties.PrincipalMomentsOfInertia(J(1), J(2), J(3))

If I use this same function in an Assembly I get an error.

 

Presumably, moments of inertia for assemblies are handled differently?

 

Any suggestions?

Labels (2)
2 REPLIES 2
Message 2 of 3

It works as expected

Sub GetPrincipalMomentsOfInertiaOfAssembly()
    Dim asmDef As AssemblyComponentDefinition
    Set asmDef = ThisApplication.ActiveEditDocument.ComponentDefinition
    Dim i1 As Double
    Dim i2 As Double
    Dim i3 As Double
    Call asmDef.MassProperties.PrincipalMomentsOfInertia(i1, i2, i3)
End Sub
Message 3 of 3

So it does - I went back over my scenario and realised that the assembly that was having the problem was a Phantom Assembly with virtual components only, so there are no solid bodies, and therefore no mass props.

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

Post to forums  

Autodesk Design & Make Report