So, After verifying with hand calcs, this is what I came up with.
'Calculates the value of the inertia in Fancus preferred units of Kgf*cm*S²
Dim doc As AssemblyDocument = ThisDoc.Document
Dim massProps As MassProperties
massProps = doc.ComponentDefinition.MassProperties
'these are prinicple values. Ixy, Iyz, Ixz are not required.
Dim Ixx As Double
Dim Iyy As Double
Dim Izz As Double
Dim Ixy As Double
Dim Ixz As Double
Dim Iyz As Double
Dim EOATMass As Double
Dim Addxx As Double
Dim Addyy As Double
Dim Addzz As Double
Dim COGx As Double
Dim COGy As Double
Dim COGz As Double
Dim RadX As Double
Dim RadY As Double
Dim RadZ As Double
massProps.XYZMomentsOfInertia(Ixx, Iyy, Izz, Ixy, Ixz, Iyz)
'determin mass values
EOATMass = iProperties.Mass
EOAT_Mass = EOATMass
'Determin offset parallel mass distance
COGx = Sqrt(((iProperties.CenterOfGravity.Z)^2) + (iProperties.CenterOfGravity.Y)^2)
COGy = Sqrt(((iProperties.CenterOfGravity.X)^2) + (iProperties.CenterOfGravity.Z)^2)
COGz = Sqrt(((iProperties.CenterOfGravity.X)^2) + (iProperties.CenterOfGravity.Y)^2)
COG_x = COGx
COG_y = COGy
COG_z = COGz
Addxx = EOATMass * COGx ^ 2
Addyy = EOATMass * COGy ^ 2
Addzz = EOATMass * COGz ^ 2
GlobalIxx = (Ixx*100000) + Addxx
GlobalIyy = (Iyy*100000) + Addyy
GlobalIzz = (Izz*100000) + Addzz
'Dim msg As String = "Ixx " & Ixx.ToString()
'Use Parallel Axis Theorm to determine Global inertia based on principle values offset from origin
'MessageBox.Show(msg, "You figure out the units")
FanucIxx = Ixx * 0.00000000101971621
FanucIyy = Iyy * 0.00000000101971621
FanucIzz = Izz * 0.00000000101971621
This works for now. I can equate these to parameters and then have those parameters show up in a form, so this seems to work well. The only thing I'd like to be able to do, is control the format that the variables show up as...i.e. 2 decimal places versus 10 or whatever, but this is good enough.
Secondly, its odd to me that my template file has units set to mm and g for default units of distance and mass, but I still have to apply a conversion factor to Ixx, Iyy, and Izz ? so they are at their root kg*cm² regardless of the files unit settings?
Ohh, and these were the Parameters I created.
