I need moment of inertia from Assembly and part file in NX through API.
Currentlythis is what i have tried.
Dim measureBodies2 As MeasureBodies
measureBodies2 = workPart.MeasureManager.NewMassProperties(massUnit
But dont know API to get MOI from measureBodies2.
Please help me to get this .
Any help would be appreciated.
Thanks in advance.
Good morning. You can get that with the Open C call UF_MODL_ask_mass_props_3d. This is also wrapped for use in .Net as UFModl.AskMassProps3d.
As with most of the wrapped calls, you need to see the details in the Open C Reference Guide.
This method provides a great deal of information in a large array of values:
|double||mass_props [ 47 ]||Output||Mass properties
 = Surface Area
 = Volume (0.0 For Thin Shell)
 = Mass
[3-5] = Center Of Mass (COFM), WCS
[6-8] = First Moments (centroidal)
[9-11] = Moments Of Inertia, WCS
[12-14] = Moments Of Inertia (centroidal)
 = Spherical Moment Of Inertia
[16-18] = Inertia Products, WCS
[19-21] = Inertia Products (centroidal)
[22-30] = Principal Axes, WCS
[31-33] = Principal Moments (centroidal)
[34-36] = Radii Of Gyration, WCS
[37-39] = Radii Of Gyration (centroidal)
 = Spherical Radius Of Gyration
[41-45] = Unused
 = Density
Note that these are relative to the WCS, rather than the absolute CSYS,which is a bit unusual in the API.