- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
is it possible to calculate the moment of inertia to a ucs or given point?
https://en.wikipedia.org/wiki/Parallel_axis_theorem
Thank you
Georg
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
First part:
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
m_invApp = GetObject(, "Inventor.Application")
' Set a reference to the part document.
' This assumes a part document is active.
Dim oAssyDoc As AssemblyDocument
oAssyDoc = m_invApp.ActiveDocument
' Set a reference to the mass properties object.
Dim oMassProps As MassProperties
oMassProps = oAssyDoc.ComponentDefinition.MassProperties
'Check if mass property results are already available
'at a high accuracy level or better. If so, simply
'print out the results, else, set a flag to not cache
'the results in the document.
If oMassProps.AvailableAccuracy = MassPropertiesAccuracyEnum.k_High And
oMassProps.AvailableAccuracy = MassPropertiesAccuracyEnum.k_VeryHigh Then
' Set the accuracy to high.
oMassProps.Accuracy = MassPropertiesAccuracyEnum.k_High
'Set CacheResultsOnCompute property to False
'so that results are not saved with the document
'and hence the document is not 'dirtied'.
oMassProps.CacheResultsOnCompute = False
End If
' Display the mass properties of the part.
Debug.Print("Area: " & oMassProps.Area)
ListBox1.Items.Add("Area: " & oMassProps.Area)
Debug.Print("Center of Mass: " & oMassProps.CenterOfMass.X & ", " & oMassProps.CenterOfMass.Y & ", " & oMassProps.CenterOfMass.Z)
ListBox1.Items.Add("Center of Mass: " & oMassProps.CenterOfMass.X & ", " & oMassProps.CenterOfMass.Y & ", " & oMassProps.CenterOfMass.Z)
ListBox1.Items.Add("")
Debug.Print("Mass: " & oMassProps.Mass)
ListBox1.Items.Add("Mass: " & oMassProps.Mass)
ListBox1.Items.Add("")
Dim adPrincipalMoments(0 To 3) As Double
Call oMassProps.PrincipalMomentsOfInertia(adPrincipalMoments(1),
adPrincipalMoments(2),
adPrincipalMoments(3))
Debug.Print("Principal Moments of Inertia: " & adPrincipalMoments(1) & ", " & adPrincipalMoments(2) & ", " & adPrincipalMoments(3))
ListBox1.Items.Add("Principal Moments of Inertia: " & adPrincipalMoments(1) & ", " & adPrincipalMoments(2) & ", " & adPrincipalMoments(3))
ListBox1.Items.Add("")
Dim adRadiusOfGyration(0 To 3) As Double
Call oMassProps.RadiusOfGyration(adRadiusOfGyration(1),
adRadiusOfGyration(2),
adRadiusOfGyration(3))
Debug.Print("Radius of Gyration: " & adRadiusOfGyration(1) & ", " & adRadiusOfGyration(2) & ", " & adRadiusOfGyration(3))
ListBox1.Items.Add("Radius of Gyration: " & adRadiusOfGyration(1) & ", " & adRadiusOfGyration(2) & ", " & adRadiusOfGyration(3))
ListBox1.Items.Add("")
Debug.Print("Volume: " & oMassProps.Volume)
ListBox1.Items.Add("Volume: " & oMassProps.Volume)
ListBox1.Items.Add("")
Dim Ixx As Double
Dim Iyy As Double
Dim Izz As Double
Dim Ixy As Double
Dim Iyz As Double
Dim Ixz As Double
Call oMassProps.XYZMomentsOfInertia(Ixx, Iyy, Izz, Ixy, Iyz, Ixz)
Debug.Print("Moments: ")
ListBox1.Items.Add("Moments: ")
Debug.Print(" Ixx: " & Ixx)
ListBox1.Items.Add(" Ixx: " & Ixx)
Debug.Print(" Iyy: " & Iyy)
ListBox1.Items.Add(" Iyy: " & Iyy)
Debug.Print(" Izz: " & Izz)
ListBox1.Items.Add(" Izz: " & Izz)
Debug.Print(" Ixy: " & Ixy)
ListBox1.Items.Add(" Ixy: " & Ixy)
Debug.Print(" Iyz: " & Iyz)
ListBox1.Items.Add(" Iyz: " & Iyz)
Debug.Print(" Ixz: " & Ixz)
ListBox1.Items.Add(" Ixz: " & Ixz)
End SubHow could I measure the distance between the center of gravity and a point?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Use ComponentDefinition.MassProperties.CenterOfMass, if you want intellisense to work, you must use a PartComponentDefinition or an AssemblyComponentDefinition. CenterOfMass is a point, you can then calc against any other point. But I see that you have done that in the posted code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
To measure distance, GetMiniumumDistance method would be useful. For more details, refer below help documentation link.
http://help.autodesk.com/view/INVNTOR/2019/ENU/?guid=GUID-240D2F92-2701-4D9D-BCE7-02759538E2FC
Thanks and regards,
CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello @chandra.shekar.g,
how could I mesaure between the center of mass and the point directly?
Thank you
Georg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report