A Reddit thread about exporting countersunk flat patterns to DXF recently generated 14 replies. Every single one suggested a model edit: suppress the countersink, delete the chamfer feature, open the flat pattern in a drawing and manually remove the circles before exporting. Not one mentioned that SolidWorks has had a built-in DXF layer mapping feature for years that routes countersink geometry to a separate reference layer at export time — no model changes required.
That gap between what the software can do and what most users know about is exactly where bad workflows breed.
What DXF Layer Mapping Actually Does
When SolidWorks exports a flat pattern to DXF, it dumps all geometry — cut edges, bend lines, etch sketches, countersink inner and outer circles, form tool outlines — onto a single layer by default. The result is a DXF that your laser cutter’s CAM software has to parse manually: someone has to pick through the file and tell the machine which polylines are cuts, which are reference geometry, which are score lines.
The SW Map File feature fixes this by letting you define a mapping from SolidWorks entity types to named DXF layers before the export happens. Geometry goes to CUT. Sketches go to ETCH. Bend lines split into BEND-UP and BEND-DOWN. Forming tools — including countersinks — go to REFERENCE. The CAM software reads the layer name, knows what to do with it, and nobody touches the model.
Where to Find It
The setting is buried in System Options, which is why most people miss it.
Go to Tools → System Options → Export. Change the File Format dropdown to DXF/DWG. You’ll see a checkbox labelled Custom Map SOLIDWORKS to DXF/DWG (the exact label varies slightly by version — some versions call it Enable Map File). Check it.
Once enabled, two buttons appear: Define Layers and Map Entities. These are the two halves of the feature. An alternative entry point is via File → Save As → (DXF/DWG) and clicking the Options button — same dialog.
Setting Up Your Layers
In Define Layers, you create the layer structure that will appear in the output DXF. Each layer has three attributes:
- Name — the string that appears in the DXF layer table and that your CAM software reads. Use whatever naming convention your shop or fabricator expects. Common conventions:
CUT,ETCH,SCORE,BEND-UP,BEND-DOWN,REFERENCE,DIMENSIONS. - Color — the RGB color assigned to entities on that layer. Laser cutters that use color-based routing (common with fiber cutters and CO2 machines that distinguish engrave vs. cut paths by color) read this field. Red is conventionally cut, blue is often engrave/score.
- Line style — solid, dashed, or dash-dot. Most CAM software ignores line style and routes by layer name or color, but setting it correctly here costs nothing.
A minimal setup for a laser cutting shop looks like this:
| Layer name | Color | Entity type |
|---|---|---|
| CUT | Red (#FF0000) | Geometry edges |
| ETCH | Blue (#0000FF) | Sketch entities |
| BEND-UP | Green (#00FF00) | Bend lines up |
| BEND-DOWN | Cyan (#00FFFF) | Bend lines down |
| REFERENCE | Gray (#808080) | Forming tools / countersinks |
Mapping Entity Types
In Map Entities, you assign each SolidWorks entity type to one of the layers you just defined. The entity type column shows a dropdown with everything that can be routed separately:
- Geometry — the model edges that form the outer cut profile and interior holes
- Sketches — 2D sketch entities that exist on the flat face, typically used for etch/score paths or text engraving
- Bend Lines Up / Bend Lines Down — the fold direction annotations that indicate fold direction
- Forming Tools — form tool footprints, which includes countersinks, louvers, lances, and embosses
- Cut-outs — some versions expose this as a separate category from general geometry
For each entity type, you can accept the layer’s color and line style (BYLAYER setting) or override them per entity. Most workflows use BYLAYER — the layer definition is the source of truth.
Solving the Countersink Problem
Here is the specific scenario from the Reddit thread: a sheet metal part has a countersunk hole. The countersink is modeled correctly — inner diameter for the fastener, outer diameter for the head — and the flat pattern is correct. But the DXF export without layer mapping includes both circles as geometry. The laser cutter sees two concentric circles and cuts the outer one, because the outer boundary is the largest closed loop. The hole ends up the size of the countersink head instead of the fastener shank. Parts go to scrap.
With layer mapping, the countersink (a forming tool in SolidWorks terms) gets assigned to REFERENCE. The fabricator’s CAM software either ignores the REFERENCE layer entirely or treats it as non-cutting annotation. The only circle the laser sees in the CUT layer is the fastener-diameter hole. Problem gone.
The same principle applies to louvers, embosses, lances, and any other feature modeled with a forming tool. If it shouldn’t drive a laser cut path, map it to a layer that doesn’t drive cuts.
Sketch-Based Etch Geometry
Laser engraving paths are often authored as 2D sketches on the flat face of the sheet metal part — a company logo, a part number, scribe lines for assembly reference. If these sketches exist in the model, they appear in the DXF export as sketch entities, which is a separate mappable category from the geometry edges.
Mapping sketches to an ETCH layer gives the CAM software a clean signal: everything on this layer is a low-power engraving pass, not a through-cut. The geometry edges on CUT remain clean cut outlines.
If you need separate layers for different power levels — score vs. deep engrave, for instance — you can put those paths on different named sketch layers inside SolidWorks first, and then map each sketch layer to a different DXF layer. The mapping dialog supports per-sketch-layer routing in newer SolidWorks versions.
Saving and Distributing the Map File
Once you’ve defined layers and mapped entities, click Save Map File. SolidWorks saves the configuration as a .swmapfile (an XML-based text file). This file can be:
- Stored on a shared network path that all workstations point to
- Checked into PDM alongside templates and toolbox settings
- Distributed to new machines during workstation setup
- Swapped between different fabricator profiles (one map for Fabricator A who uses color-based routing, another for Fabricator B who uses layer names)
To load a saved map: go back to the same System Options dialog, enable the map file, and click Load Map File. You can also use the Options button in the Save As dialog to load a specific map per-export if you need to switch profiles mid-session.
The option Don’t show mapping dialog on each save suppresses the mapping confirmation step during export once you’re satisfied with the setup. Remove this checkbox if your workflow involves switching between map files frequently.
What the Map File Does Not Control
Layer mapping covers entity-to-layer routing. It doesn’t control:
- Which flat pattern entities are included in the export — that’s the entity selection in the flat pattern export dialog (Geometry, Bend Lines, Hidden Edges, etc.)
- Bend line trimming — bend lines that extend past the part boundary need to be trimmed separately; some tools like CadShift do this automatically during batch export
- DXF output version — R12, R2000, R2010 version selection is a separate setting in the Save As dialog. See DXF R12 vs R2000 in SolidWorks for why version matters for multi-view outputs
- Chord tolerance — the accuracy of spline approximation for curved edges
For batch exports from assemblies, the map file you set up in System Options carries through to all exports from that session. When using CadShift’s batch DXF export, the active map file applies to every part in the assembly run, so setting it once handles the whole job.
Team Workflow
The practical value of map files is standardization. Without one, every engineer on a team may export DXF with different layer names (or no layers at all), and fabricators end up re-layering files manually before they can run them.
With a shared map file on a network path:
- An admin creates the map file once, in coordination with the primary fabricator.
- The file path is documented in the company’s CAD standards doc.
- Every workstation’s System Options points to the same file.
- Exports from any seat produce the same layer structure.
When a fabricator changes their requirements (new machine, new CAM software), update one file. The change propagates on the next export from any workstation.
Checking the Output
After exporting with layer mapping enabled, verify the result before sending to the shop. Open the DXF in a viewer that shows the layer panel — DWG FastView, AutoCAD’s free DWG TrueView, or the eDrawings DXF viewer all work. Confirm:
- Outer cut boundary is on the CUT layer
- Hole interiors are on the CUT layer
- Countersink circles are on REFERENCE (or absent from cut-driving layers)
- Bend lines appear on BEND-UP / BEND-DOWN
- Etch sketches appear on ETCH
If forming tool geometry is still appearing on CUT, check that the entity type selection in Map Entities used Forming Tools specifically, not the generic Geometry catchall. On some versions, forming tools map to Geometry by default unless explicitly routed.
For the DXF settings that control which entities appear in the export at all (before layer assignment), see SolidWorks DXF export settings and entity types. Layer mapping and entity selection are independent controls — you need both right to get a clean output. And if you’re passing these files to a nesting system, the layer naming conventions also affect how nesting software parses the file — covered in DXF to CNC nesting workflow from SolidWorks.