I was trying to do calculations on an odd shape earlier and I noticed something odd about how the region properties in sketches works. Ix and Iy appear to be calculated at the centroid but at an angle to the sketch axes (whatever the principle axes is). Ixx and Iyy are calculated from the sketch origin following the sketch axes. However the centroid has to be on the sketch origin for those values to be correct.
For a tube or symmetrical part drawn around the origin none of that matters as Ix and Ixx would be the same, but for an odd shape Ixx depends on the centroids relation to the origin and Ix depends on what the principle axes is.
Is there a simple way to get Inventor to calculate Ix/Iy about the centroid without having to move the part so the centroid is on the origin? I would like if the Ix/Iy calculation was in relation to the sketch axes instead of the principle axes, since I can't see the reason you'd want Ix/Iy on the principle axes.
Could you apply the parallel axis theorem to quickly calculate your inertia tensors about an axis of your choosing?
There is no automated tool that I'm aware of. This would make a good IdeaStation request for a new feature. However, there are API commands for the Region Properties. You may be able to write an ilogic code that utilizes the API command that would automatically calculate those inertia tensors about the centroid.
For clarity, I will go through an example. The below image is the Region Properties when the section has been rotated and centered on the Principal Axis, the axis through which rotational symmetry is obtained. This screenshot is mostly for reference. Note that Ixx and Iyy have the same values as Ix and Iy.
Next I have rotated the section to align with the default work axis and origin, but I have centered the section on the Centroid. Note that the "Centroid, with respect to Sketch Origin" values are 0 for X and Y. Also, note that the Ixx/Iyy values no longer match Ix and Iy, since they are being calculated with respect to the Sketch Origin to which they have been aligned.
Next, I will move the section 10 inches above the X axis. Since I know:
Ixx = 5.282 in^2
d = 10 in
Area = 2.089 in^2
Inewxx = Ixx + d^2 * A = 214.182 in^4
Result is that the new Ixx value is 214.198 in^4. The difference (214.198 - 214.182 = .016 or .00746972 % Error ) is due to the difference in precision Inventor and I used to calculate the results.
To get a better idea of the API commands, you can Help drop down menu > Community Resources > Programming Help and search for RegionProperties Object. There is a sample for querying a sketch profile to get regions that should be a good start.
Let me know if this helps or if you have any questions.
I took a crack at some code that should get you started. This ilogic code will apply the parallel axis theorem about the centroid automatically for you. I must warn you that I haven't tested this code extensively, but it seems to work for the simple example that I demonstrated earlier.
Please review and let me know if you have any questions. Hope this helps. Thanks!
'Check that sketch is active If TypeOf ThisApplication.ActiveEditObject Is Sketch Then 'Do Nothing Else MessageBox.Show("A sketch must be active with a closed profile.", "WARNING") Return End If ' a reference to the active sketch. ' This assumes a 2D sketch is active. Dim oSketch As Sketch oSketch = ThisApplication.ActiveEditObject Dim oRegionProps As RegionProperties oRegionProps = oSketch.Profiles.AddForSolid.RegionProperties ' the accuracy to Low oRegionProps.Accuracy = 69377 Dim Ixx, Iyy, Izz, Ixy, Iyz, Ixz As Double Call oRegionProps.MomentsOfInertia(Ixx, Iyy, Izz, Ixy, Iyz, Ixz) 'Parallel Axis Theorem Applied About Centroid Dim IxCon As Double IxCon=Ixx-oRegionProps.Area * oRegionProps.Centroid.Y^2 Dim IyCon As Double IyCon=Iyy-oRegionProps.Area * oRegionProps.Centroid.X^2 Dim oMessage As String Dim oConMessage oMessage= "Current Location Properties: " & vbCrLf & _ "Area: " & oRegionProps.Area & vbCrLf & "Centroid (X,Y): " & _ oRegionProps.Centroid.X & ", " & oRegionProps.Centroid.Y & vbCrLf & _ " Ixx: " & Ixx & vbCrLf & " Iyy: " & Iyy & vbCrLf & _ vbCrLf & "Parallel Axis Theorem" & vbCrLf & _ "Applied About Centroid:" & vbCrLf & _ " Ixx (centroid): " & IxCon & vbCrLf & " Iyy (centroid): " & IyCon Dim oUOM As UnitsOfMeasure ' 11272 is inch, 11268 is cm oUOM = ThisApplication.ActiveDocument.UnitsOfMeasure Dim oRegionPropsCon As RegionProperties Dim ConArea, ConCentroidX,ConCentroidY, ConIxx, ConIyy, ConIxCon, ConIyCon As Double ConCentroidX=oUOM.ConvertUnits(oRegionProps.Centro
id.X, 11268,11272) ConCentroidY=oUOM.ConvertUnits(oRegionProps.Centro id.Y, 11268,11272) 'Conversion factors Dim oConversionFactorArea As Double Dim oConversionFactorInertia As Double oConversionFactorArea=oUOM.ConvertUnits(1, 11268,11272)^2 oConversionFactorInertia=oUOM.ConvertUnits(1, 11268,11272)^4 ConArea=oRegionProps.Area*oConversionFactorArea ConIxx=Ixx*oConversionFactorInertia ConIyy=Iyy*oConversionFactorInertia ConIxCon=IxCon*oConversionFactorInertia ConIyCon=IyCon*oConversionFactorInertia oConMessage= "Current Location Properties: " & vbCrLf & _ "Area: " & ConArea & vbCrLf & "Centroid (X,Y): " & _ ConCentroidX & ", " & ConCentroidY & vbCrLf & _ " Ixx: " & ConIxx & vbCrLf & _ " Iyy: " & ConIyy & vbCrLf & vbCrLf & "Parallel Axis Theorem "& vbCrLf & _ "Applied About Centroid:" & vbCrLf & " Ixx (centroid): " & _ ConIxCon & vbCrLf & " Iyy (centroid): " & ConIyCon ' oRegionPropsCon = oUOM.ConvertUnits(oRegionProps, 11268,11272) ' Dim oMessageCon As String ' oMessageCon="Area: " & oRegionPropsCon.Area & vbCrLf & "Centroid: " & _ ' oRegionPropsCon.Centroid.X & ", " & _ ' oRegionPropsCon.Centroid.Y & vbCrLf & " Ixx: " &_ ' Ixx & vbCrLf & " Iyy: " & Iyy & vbCrLf & " Ixy: " & Ixy ' MessageBox.Show(oMessage, "Default (cm)") MessageBox.Show(oConMessage, "Default (in)")
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register
Start with some of our most frequented solutions to get help installing your software.