Hi @dominiek_vanwest. It is unfortunate that we can't get the exact values we are looking for using 'bounding box' methods, but those are not our only options. If exact measurements are needed, then we can simulate measuring that thickness by code instead. There are likely multiple routes to do that, but below is one example of an iLogic rule designed with just that task in mind. All it does is dig down to the existing FlatPattern object (does nothing if it does not already exist), then gets its 'top face' and 'bottom face', then gets the 'Plane' that their geometry represents, then uses a built-in geometry measurement method to get the value we are looking for. Then, it takes the extra step of converting the units of the measurement to 'document units', if those are different from the 'database units' (centimeters), for convenience. Then I just included 2 different ways to provide that raw, un-rounded value as feedback (show it in a MsgBox, or write it to the iLogic Log window). I hope this helps. I have seen a few situations over the years where one of those two Properties of the FlatPattern did not return a valid value, so if needed, you could always include a few more checks and/or use a Try...Catch...End Try statement (or few) in there to help.
Sub Main
Dim oPDoc As Inventor.PartDocument = TryCast(ThisDoc.Document, Inventor.PartDocument)
If oPDoc Is Nothing Then Return
If Not TypeOf oPDoc.ComponentDefinition Is Inventor.SheetMetalComponentDefinition Then Return
Dim oSMDef As Inventor.SheetMetalComponentDefinition = oPDoc.ComponentDefinition
If oSMDef.HasFlatPattern Then
Dim oFP As Inventor.FlatPattern = oSMDef.FlatPattern
Dim dMeasuredThickness As Double = 0.0
Dim oTopPlane As Inventor.Plane = oFP.TopFace.Geometry
Dim oBottomPlane As Inventor.Plane = oFP.BottomFace.Geometry
dMeasuredThickness = Math.Abs(oTopPlane.DistanceTo(oBottomPlane.RootPoint))
Dim UOM As Inventor.UnitsOfMeasure = oPDoc.UnitsOfMeasure
If Not UOM.LengthUnits = UnitsTypeEnum.kDatabaseLengthUnits Then
dMeasuredThickness = UOM.ConvertUnits(dMeasuredThickness, UnitsTypeEnum.kDatabaseLengthUnits, UOM.LengthUnits)
End If
MsgBox("The FlatPattern's Measured Thickness Is:" & _
vbCrLf & dMeasuredThickness.ToString(), vbInformation, "FlatPattern Thickness Measurement")
Logger.Info("The FlatPattern's Measured Thickness Is:" & _
vbCrLf & dMeasuredThickness.ToString())
End If
End Sub
If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.
Wesley Crihfield

(Not an Autodesk Employee)