1 Answers
A:
Step-by-Step VBA Snippet:
Sub GetFlatPatternSize()
Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument
If Not oDoc.ComponentDefinition.HasFlatPattern Then
oDoc.ComponentDefinition.Unfold
End If
Dim oFlatPattern As FlatPattern
Set oFlatPattern = oDoc.ComponentDefinition.FlatPattern
Dim oExtents As Box
Set oExtents = oFlatPattern.RangeBox
Dim length As Double
Dim width As Double
length = Abs(oExtents.MaxPoint.X - oExtents.MinPoint.X)
width = Abs(oExtents.MaxPoint.Y - oExtents.MinPoint.Y)
' Convert from cm to mm (Inventor internal units are cm)
length = length * 10
width = width * 10
MsgBox "Flat Pattern Size: " & Format(length, "0.00") & " mm x " & Format(width, "0.00") & " mm"
End Sub
Autodesk Inventor
AutodeskHelp the community
Be the First to Answer these questions
Disclaimer
Techjockey’s software industry experts offer advice for educational and informational purposes only. A category or product query or issue posted, created, or compiled by Techjockey is not meant to replace your independent judgment.
20,000+ Software Listed
Best
Price Guaranteed
Free Expert
Consultation
2M+
Happy Customers