Here's some iLogic code you can use. In the MsgBox, I'm dividing by 2.54 to convert centimeters to inches.
To just get the Perimeter, you can change the loop, to simply checking if the oEdgeLoop.IsOuterEdgeLoop, then use that one in your MsgBox. You could also put checks at the top to check DocumentTypeEnum and SubType, if you wanted.
Dim oSMDoc As PartDocument = ThisApplication.ActiveDocument
Dim oSMDef As SheetMetalComponentDefinition = oSMDoc.ComponentDefinition
If oSMDef.HasFlatPattern = False Then
MsgBox("There is no Flat Pattern yet.", vbOKOnly, "NO FLAT PATTERN")
Return
End If
Dim oTopFace As Face = oSMDef.FlatPattern.TopFace
Dim oMeasureTools As MeasureTools = ThisApplication.MeasureTools
Dim oLoopLength As Double = 0
For Each oEdgeLoop As EdgeLoop In oTopFace.EdgeLoops
oLoopLength = oLoopLength + oMeasureTools.GetLoopLength(oEdgeLoop)
Next
MsgBox("Loop Length = " & oLoopLength/2.54)
I hope this helps.
If this solves your problem, or answers your questions, please click 'Accept As Solution".
Or, if this helps you reach your goal, please click 'LIKES" 👍.
Also, if you're interested, here are a few of the 'Ideas' I'd like to get implemented.
If you agree with any of them, please vote for them.
- Add more capabilities to the 'Customize' dialog box (exe. Add Tab & Add Panel) Click Here
- MessageBox, InputBox, and InputListBox Size & Format Options Click Here
- Constrain & Dimension Images In Assembly Sketches & Drawing Sketches (TitleBlocks & SketchedSymbols) Click Here
- Save Section View Status In DesignViewRepresentation (So It Can Be Used In The Drawing) Click Here
- Add SolidBodies Folder In iLogic Rule Editor Model Tab Click Here
- Convert All Views To Raster Before Autosave Stores To 'OldVersions' Folder Click Here
- SetDesignViewRepresentation - Fix limitations for DrawingView of a Part Click Here
- Create DocumentSubTypeEnum Click Here
Inventor 2020 Help | Inventor Forum | Inventor Customization Forum | Inventor Ideas Forum
Wesley Crihfield

(Not an Autodesk Employee)