Inventor General

## Inventor General

Mentor
Posts: 202
Registered: ‎04-20-2012
Message 1 of 4 (243 Views)

# Region properties in sketch confusion

243 Views, 3 Replies
01-08-2014 09:50 AM

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.

Product Support
Posts: 476
Registered: ‎11-22-2011
Message 2 of 4 (172 Views)

# Re: Region properties in sketch confusion

01-08-2014 05:32 PM in reply to: pball

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.

Thanks,

Nathan Chandler

Mentor
Posts: 202
Registered: ‎04-20-2012
Message 3 of 4 (144 Views)

# Re: Region properties in sketch confusion

01-09-2014 06:37 AM in reply to: innovatenate

I think I will take a look at the API stuff and use the parallel axis theorem to spit out the numbers I want.

I think I'll also make an idea station post. It'd be nice if you choose between the two methods it uses to calculate the moment of inertia by and a third option to calculate the moment of inertia about the centroid which it doesn't do. The first time I used this tool it was on a square tube so Ixx and Ix were the same, so when I used it on an angle and they were different I was confused and had to figure what the difference was. Not to mention my hand calculation was different from Ixx because the angle didn't have it's centroid on the sketch origin.
Product Support
Posts: 476
Registered: ‎11-22-2011
Message 4 of 4 (120 Views)

# Re: Region properties in sketch confusion

01-09-2014 10:25 AM in reply to: pball

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
' 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.Centroid.X, 11268,11272)
ConCentroidY=oUOM.ConvertUnits(oRegionProps.Centroid.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)")

```

Nathan Chandler

Recently Solved

Inventor