Hi @DeerSpotter.
When using the SheetMetal.FlatExtents... property call directly, I receive results in document units. This is my test for that. Start from your Flat Pattern being active on your screen, then use your manual measure tool to inspect the top main flat face of the part. When I measure width & length (along X & Y axis), and measure area, the dialog shows these in document units, so I know what they are supposed to be. Then I run this rule to see the result returned by those iLogic property calls.
Dim oSMW As Double = SheetMetal.FlatExtentsWidth
Dim oSML As Double = SheetMetal.FlatExtentsLength
Dim oSMA As Double = SheetMetal.FlatExtentsArea
MsgBox("Sheet Metal Width = " & oSMW.ToString("0.0") & vbCrLf & _
"Sheet Metal Length = " & oSML.ToString("0.0") & vbCrLf & _
"Sheet Metal Area = " & oSMA.ToString("0.0"), vbOKOnly, "SHEET METAL SIZE")
That is just one way of getting those numbers. However, there is also two sets of regular iProperties that you can check the values of. These other 'regular' iProperties are zero by default though, until you have done something like calculating physical properties or have generated a flat pattern previously. Here is an iLogic rule for checking these other sheet metal size properties.
oDoc = ThisDoc.Document
If TypeOf oDoc Is PartDocument And
TypeOf oDoc.ComponentDefinition Is SheetMetalComponentDefinition Then
Dim oDTProps As PropertySet = oDoc.PropertySets.Item(3)
Dim oSMW As String = oDTProps.Item("Sheet Metal Width").Value
Dim oSML As String = oDTProps.Item("Sheet Metal Length").Value
Dim oSMA As String = oDTProps.Item("Sheet Metal Area").Value
MsgBox("Sheet Metal Width = " & oSMW & vbCrLf & _
"Sheet Metal Length = " & oSML & vbCrLf & _
"Sheet Metal Area = " & oSMA, vbOKOnly, "SHEET METAL SIZE")
Dim oFPW As String = oDTProps.Item("Flat Pattern Width").Value
Dim oFPL As String = oDTProps.Item("Flat Pattern Length").Value
Dim oFPA As String = oDTProps.Item("Flat Pattern Area").Value
MsgBox("Flat Pattern Width = " & oFPW & vbCrLf & _
"Flat Pattern Length = " & oFPL & vbCrLf & _
"Flat Pattern Area = " & oFPA, vbOKOnly, "FLAT PATTERN SIZE")
End If
You will notice that the 'Sheet Metal' iProperties here return document units, while the 'Flat Pattern' iProperties here return default metric units (centimeters & centimeters squared).
There is a built-in tool for converting units that you could use (oDoc.UnitsOfMeasure.ConvertUnits()), or you could just include some simple math to convert the units.
If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.
If you want and have time, I would appreciate your Vote(s) for My IDEAS 💡or you can Explore My CONTRIBUTIONS
Wesley Crihfield

(Not an Autodesk Employee)