The checkbox that lies to you

Open a multi-body sheet metal part in SolidWorks and try to export DXF. File → Save As → DXF → Options. The “Export multiple flat patterns to single file” checkbox is greyed out. So is the standard “Flat Pattern” export mode. The dialog offers you geometry, hidden lines, and sketches — everything except what you actually need.

This catches shops transitioning from separate-part workflows to multi-body assembly files. The multi-body approach makes sense for welded sheet metal assemblies: fewer files, shared reference sketches between bodies, no insert-part reference chains that break when you rename anything. But the DXF export dialog treats the whole assembly as one thing and can’t figure out which flat pattern to export.

This is not a bug. It’s a design limitation that’s been there since SolidWorks added multi-body sheet metal support, and it hasn’t been fixed in the export dialog.

Why the dialog works this way

SolidWorks’ flat pattern export goes through a code path that requires one unambiguous active flat pattern feature. In a single-body sheet metal part, that’s always clear — there’s one SheetMetal folder in the FeatureManager, one FlatPattern sub-feature, and that’s what gets exported.

In a multi-body part with six sheet metal bodies, the FeatureManager has six SheetMetal folders, each with its own FlatPattern feature. The export dialog has no mechanism to ask “which one?” It was designed around the single-body assumption, and exposing per-body selection would require redesigning the export flow.

The underlying API does support per-body flat pattern export. The dialog just doesn’t expose it. That gap between what the API can do and what the dialog exposes is where the workarounds live.

Workaround 1: Save Bodies to separate part files

No code required. Use Insert → Features → Save Bodies to split your multi-body part into individual part files, then use any standard batch DXF export tool on those files.

Insert → Features → Save Bodies
  ├── Set output folder
  ├── Name each body before running (SolidWorks uses body names as filenames)
  └── Optional: check "Create Assembly" to maintain the reference structure

Each saved part is now a standard single-body sheet metal part. You can select them all and batch export with Task Scheduler, a macro, or CadShift.

The real problem with this approach: the saved body files maintain a live reference to the parent part. When the parent changes, you have to re-run Save Bodies and re-export. For a part that gets revised frequently, this creates a two-step sync process that most teams forget to do consistently.

Body names also default to the internal SolidWorks body identifier — usually something like Surface-Extrude1[1] — not your custom property values. You need to rename bodies in the FeatureManager before running Save Bodies if you want usable filenames downstream. In a 12-body electrical panel part, that’s 12 manual rename operations per revision.

Workaround 2: VBA macro with per-body suppression

A macro can automate what Save Bodies does manually: for each sheet metal body, suppress all other bodies’ flat patterns, export the active one, then restore state.

The key API calls:

' Get all solid bodies in the part
Dim vBodies As Variant
vBodies = swPart.GetBodies2(swBodyType_e.swSolidBody, True)

' Find flat pattern features by traversing the FeatureManager
Dim swFeat As SldWorks.Feature
Set swFeat = swModel.FirstFeature()

Do While Not swFeat Is Nothing
    If swFeat.GetTypeName2() = "SheetMetal" Then
        Dim swSubFeat As SldWorks.Feature
        Set swSubFeat = swFeat.GetFirstSubFeature()
        Do While Not swSubFeat Is Nothing
            If swSubFeat.GetTypeName2() = "FlatPattern" Then
                ' Found a flat pattern feature
                ' Suppress all others, unsuppress this one
                ' Export, then restore
            End If
            Set swSubFeat = swSubFeat.GetNextSubFeature()
        Loop
    End If
    Set swFeat = swFeat.GetNextFeature()
Loop

The suppression loop itself is straightforward. The problem is what happens after each suppress operation: SolidWorks rebuilds the model. On a part with deep feature trees or complex geometry, each rebuild can take 10-30 seconds. For a 10-body electrical panel, you’re looking at 100-300 seconds of rebuild time for a simple export operation.

You also need to handle the body-to-flat-pattern mapping explicitly. The feature traversal gives you FlatPattern features, but matching each one to the correct body requires reading IFlatPatternFeatureData.FixedFace and comparing against your body list. The code that looks simple in outline gets complex in practice.

Where this breaks: macros that suppress and unsuppress features will occasionally corrupt the model’s regeneration state if interrupted. They also break the moment SolidWorks changes internal feature type names (this has happened between major versions). The body matching via FixedFace is not documented as stable API.

The other gap: a macro won’t apply your layer mapping template, won’t read custom properties for filenames, and won’t handle the edge cases from multi-body orientation and handed parts. You’d need to add all of that yourself.

Workaround 3: Full API add-in

The correct solution at the architectural level is an add-in that uses IFlatPatternFeatureData to access each flat pattern directly — without touching the display state or triggering rebuilds — then exports each one independently.

The sequence:

  1. Get all solid bodies: IPartDoc.GetBodies2
  2. For each body, find its associated flat pattern feature by traversing the SheetMetal folder and reading IFlatPatternFeatureData.FixedFace to confirm body association
  3. Export each flat pattern using the API’s flat pattern export path, bypassing the dialog entirely
  4. Apply file naming from custom properties ($PRP:Description, $PRP:Material, $PRP:PartNo, etc.)
  5. Apply layer mapping from a template

This is what CadShift does. For a 10-body electrical panel, the API-direct approach takes roughly 2-4 seconds per body with no rebuild cycles. The VBA suppress/unsuppress approach takes 30-300 seconds per body depending on feature tree complexity.

The gap between 30 seconds and 3 seconds doesn’t seem important until you have 50-part assemblies with multi-body parts throughout. Then the batch export that should take 5 minutes takes 45.

The metadata problem that compounds everything

Regardless of which export workaround you use, multi-body parts have a second structural problem: custom properties don’t exist at the body level in SolidWorks.

Standard custom properties (File → Properties) are document-level. If you have a 6-body part where each body is a different material and thickness, there’s no built-in place to store per-body metadata.

Teams handle this several ways:

  • One configuration per body, with configuration-specific custom properties. Works, but creates configuration bloat and makes the file slower.
  • Body attributes, using IBody2.AddAttribute to attach name-value pairs directly to the body object. These are invisible in the SolidWorks UI and require API code to read.
  • Body naming conventions, encoding metadata in the body name itself (2mm-304SS-BracketLeft). Brittle but simple.

The Save Bodies workaround actually solves this problem cleanly: each saved part file gets its own standard custom properties panel. This is one reason Save Bodies remains the practical choice for many teams despite the sync overhead.

A macro approach has to implement one of the above metadata schemes explicitly. An add-in can read whichever scheme your team already uses.

Which workaround for which situation

SituationBest approach
Infrequent exports, small body countSave Bodies manually
Frequent exports, team has a VBA developerMacro with suppress/unsuppress
High body count, metadata requirements, production useDedicated add-in
Already using CadShift for assembly exportsMulti-body parts work automatically

The part count where the add-in approach pays for itself varies by shop. If you’re exporting multi-body parts more than once a week, the rebuild time from the macro approach alone exceeds the cost of a proper tool within a month.