Blog · Inventor · 30 Oct 2026 · 8 min read · By Stefano B.

Inventor export flat pattern to DXF with iLogic: every part of an assembly, checked 1:1

Run one iLogic rule in the assembly and you get a DXF of every sheet metal flat pattern, plus a text file that tells you if each DXF has the right size. Below: what the export options change in the file, and what you lose when you save the DXF from a drawing.

Short answer: to export the flat pattern to DXF in Inventor without a drawing, call DataIO.WriteDataToFile("FLAT PATTERN DXF?AcadVersion=R12", path) on each sheet metal part. The rule below does it for every part of an assembly, writes the files into a new folder, and checks that each DXF has the same size as its flat pattern.

Full A2 drawing of the test Z bracket, 6 mm plate, R8 inside radius: front view dimensioned 114, 94, 134, (202), thickness 6, R8 int.; top view with width 150; side and isometric views; flat pattern 319.4 x 150 x 6 dimensioned 88.36, 122.71, 108.36, (319.4), (150), with the bend lines and Inventor's bend notes DOWN 90.00° R8 and UP 90.00° R8 in orange; edge view with thickness 6; border and title block. Dimensions added to the image.
The test part: one bent bracket, its drawing and its flat pattern.
Result of one run on a test assembly: the DXF of the test Z bracket, flat 319.43 x 150 x 6 mm, with the bend lines in orange (DOWN 90° R8 int. and UP 90° R8 int.) dimensioned 88.36, 122.71, 108.36, overall (319.43); below, the six lines of the check file: two parts OK, two not sheet metal, one without a flat pattern, one skipped as duplicate name.
One run on the assembly: one DXF per part and a check file.

We ran the rule on this page as an iLogic rule in Inventor 2025.2 on a test assembly we built for it. The assembly has two copies of our Z test bracket (6 mm plate, R8 inside radius, flat 319.43 × 150 mm). It also has one bracket without a flat pattern, two parts that are not sheet metal, and a copy of a bracket with the same file name in another folder. The images are redrawn from the DXF files of these runs. In the two drawing images, the first and the last, the dimensions are drawn on the image (the drawing we exported has none) and the decimal commas of Inventor's bend notes are shown as points; in the first the author field of the title block is blanked, in the last the border and title block are left out. In the check file image the numbers are shown with decimal points (our PC uses commas, so the real file says 319,43) and the path in the last line is shortened.

This came up on the Autodesk forum: How to export 1:1 DXF files for sheet metal and fabrication. Our answer there has an earlier version of this rule. This page is the long answer.

The rule

' Run in the assembly. For every sheet metal part with a flat pattern:
' writes a DXF of the flat pattern (model space, no drawing, no view scale)
' and checks the DXF size against the flat pattern size.
' Output: a new folder DXF_<date_time> next to the assembly (old DXF are never overwritten)
' + _dxf_check.txt with one line per part.
' The check compares each DXF with its own flat pattern: it can't tell if the flat pattern is out of date.
Sub Main()
    Dim dxfFormat As String = "FLAT PATTERN DXF?AcadVersion=R12"   ' CHANGE: add options here, see the table
    Dim tolerance As Double = 0.05                                 ' CHANGE: allowed difference in mm
    Dim oAsm As AssemblyDocument = ThisDoc.Document
    Dim outFolder As String = System.IO.Path.GetDirectoryName(oAsm.FullFileName) & "\DXF_" & Now.ToString("yyyyMMdd_HHmmss")   ' CHANGE if you want another folder
    System.IO.Directory.CreateDirectory(outFolder)
    Dim report As New System.Text.StringBuilder()
    Dim usedNames As New System.Collections.Generic.HashSet(Of String)(StringComparer.OrdinalIgnoreCase)

    For Each oDoc As Document In oAsm.AllReferencedDocuments
        If oDoc.DocumentType <> DocumentTypeEnum.kPartDocumentObject Then Continue For
        Dim partName As String = System.IO.Path.GetFileNameWithoutExtension(oDoc.FullFileName)
        ' two parts with the same file name in different folders would give the same DXF name
        If Not usedNames.Add(partName) Then
            report.AppendLine(partName & ": DUPLICATE NAME, skipped (" & oDoc.FullFileName & ")")
            Continue For
        End If
        If oDoc.SubType <> "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then
            report.AppendLine(partName & ": not sheet metal, skipped")
            Continue For
        End If
        Dim oSM As SheetMetalComponentDefinition = oDoc.ComponentDefinition
        If Not oSM.HasFlatPattern Then
            report.AppendLine(partName & ": no flat pattern, skipped")
            Continue For
        End If
        Try
            Dim dxfPath As String = outFolder & "\" & partName & ".dxf"
            oSM.DataIO.WriteDataToFile(dxfFormat, dxfPath)

            ' flat pattern size in mm (API lengths are in cm)
            Dim flatA As Double = Math.Max(oSM.FlatPattern.Length, oSM.FlatPattern.Width) * 10
            Dim flatB As Double = Math.Min(oSM.FlatPattern.Length, oSM.FlatPattern.Width) * 10
            ' DXF size from the $EXTMIN / $EXTMAX header
            Dim ext() As Double = DxfExtents(dxfPath)
            Dim dxfA As Double = Math.Max(ext(2) - ext(0), ext(3) - ext(1))
            Dim dxfB As Double = Math.Min(ext(2) - ext(0), ext(3) - ext(1))

            Dim ok As Boolean = Math.Abs(flatA - dxfA) < tolerance And Math.Abs(flatB - dxfB) < tolerance
            report.AppendLine(partName & ": flat " & flatA.ToString("0.00") & " x " & flatB.ToString("0.00") & _
                " / dxf " & dxfA.ToString("0.00") & " x " & dxfB.ToString("0.00") & If(ok, "  OK", "  CHECK THIS ONE"))
        Catch ex As Exception
            report.AppendLine(partName & ": ERROR " & ex.Message)
        End Try
    Next

    System.IO.File.WriteAllText(outFolder & "\_dxf_check.txt", report.ToString())
End Sub

' Returns minX, minY, maxX, maxY read from the DXF header.
' InvariantCulture: the DXF always uses a dot, a PC with comma decimals would misread it.
Function DxfExtents(dxfPath As String) As Double()
    Dim lines() As String = System.IO.File.ReadAllLines(dxfPath)
    Dim ext(3) As Double
    Dim inv As System.Globalization.CultureInfo = System.Globalization.CultureInfo.InvariantCulture
    For i As Integer = 0 To lines.Length - 5
        Dim key As String = lines(i).Trim()
        If key = "$EXTMIN" Then
            ext(0) = Double.Parse(lines(i + 2).Trim(), inv)
            ext(1) = Double.Parse(lines(i + 4).Trim(), inv)
        ElseIf key = "$EXTMAX" Then
            ext(2) = Double.Parse(lines(i + 2).Trim(), inv)
            ext(3) = Double.Parse(lines(i + 4).Trim(), inv)
        ElseIf key = "ENDSEC" Then
            Exit For
        End If
    Next
    Return ext
End Function

What to change:

Where to paste it: open the assembly, Manage > iLogic > Add Rule, give it a name, paste, Save & Run. To start it from a script instead: run an iLogic rule from outside Inventor.

The rule writes files and nothing else: it does not unfold parts, it does not save them. A part without a flat pattern is skipped and listed. To make the flat pattern of a bent part that came in from STEP as a plain solid, see iLogic flat pattern from a STEP solid.

What the check catches, and what it doesn't

The rule reads the DXF size from the $EXTMIN / $EXTMAX header and compares it with FlatPattern.Length and Width, which the API gives in centimetres. On the test bracket both said 319.43 × 150 mm. We also measured the geometry in both DXF files with a separate DXF reader (ezdxf): 319.43 × 150, the same.

What the export options put in the DXF

Same flat pattern, four strings, each file opened and counted:

String What is in the DXF
FLAT PATTERN DXF?AcadVersion=R12 10 entities: outline, 4 lines (IV_OUTER_PROFILE); bend up, 1 line (IV_BEND); bend down, 1 line (IV_BEND_DOWN); tangent lines, 4 (IV_TANGENT). No units in the header; the numbers are mm.
...&InvisibleLayers=IV_TANGENT;IV_BEND;IV_BEND_DOWN;... 4 entities: the outline only. The hidden layers are not turned off: they are not in the file.
FLAT PATTERN DXF?AcadVersion=2018&MergeProfilesIntoPolyline=True The outline is 1 polyline instead of 4 lines. Bend and tangent lines as above. Units set to mm in the header.
...&OuterProfileLayer=CUT&InteriorProfilesLayer=CUT&BendUpLayer=BEND_UP&BendDownLayer=BEND_DOWN The same 10 entities, on layers CUT, BEND_UP, BEND_DOWN. The tangent lines stay on IV_TANGENT.

The full InvisibleLayers list we used: IV_TANGENT;IV_BEND;IV_BEND_DOWN;IV_TOOL_CENTER;IV_TOOL_CENTER_DOWN;IV_ARC_CENTERS;IV_FEATURE_PROFILES;IV_FEATURE_PROFILES_DOWN;IV_ALTREP_FRONT;IV_ALTREP_BACK;IV_ROLL_TANGENT;IV_ROLL;IV_UNCONSUMED_SKETCH_CONSTRUCTION. Holes go on IV_INTERIOR_PROFILES (Autodesk's default layer name), which is not in the list. Our test bracket has no holes, so we did not see that layer in our files.

All the options and their default layer names are on Autodesk's page Translate - Sheet Metal to DXF. Which layers your cutting software wants is a question for whoever programs the machine. For an exporter with layer colours and names, Jelte de Jong has Dxf export made easy.

The same 319.43 x 150 flat pattern in three DXF files. Default string: 10 entities, outline, bend up and bend down lines in orange, four grey tangent lines. With InvisibleLayers: 4 entities, the outline only. Saved from a drawing view: the two bend lines are on one layer, Bend Centerline (ISO), so up or down is only in the bend note text if there is one, no tangent lines, and the border and title block are in the file.
Same flat pattern, three DXF files: what is really inside.

A DXF saved from the drawing

We also put the bracket in drawings and saved them as DXF with the DXF translator's Save Copy As, called from the API with no export options set (Inventor 2025.2). First the flat pattern alone, once at 1:1 and once at 1:2. Then a full A2 drawing at 1:2: front, top and side view of the bent part, an isometric view, the flat pattern with Inventor's bend notes (we moved them below the part), and its edge view. What came out:

So in this test the scale was right, and the bend direction was there only as note text. We did not test the export dialog by hand: with other export settings the result can be different.

Views of an A2 drawing at 1:2 of the test Z bracket, saved as DXF and redrawn, with dimensions added to the image: front view 114, 94, 134, (202), thickness 6, R8 int.; top view with width 150; side and isometric views; flat pattern 88.36, 122.71, 108.36, (319.4), (150), flat 319.4 x 150 x 6, with the bend lines and Inventor's bend notes DOWN 90.00° R8 and UP 90.00° R8 in orange; edge view with thickness 6. In the DXF every view is at full size.
Drawing at 1:2, views at full size in the DXF (dimensions added to the image).

Questions people ask

Does it work on a single part? Yes, the same WriteDataToFile line works on the part's sheet metal definition. For the table above we called it on the part, from a script.

Can it write DWG? Autodesk documents FLAT PATTERN DWG as well. We did not test it.

What do I do with the DXF next? Nest them on your sheets: nesting cut parts on steel sheets from DXF profiles. How we make DXF files from a STEP: STEP to DXF cutting files.

References