Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
Changing line color of exported DXF

Hi there.
I just solved a problem I had and wanted to share the solution.
The problem is that while DXF exports of sheet metal parts can include visible sketches, these are all exported in the same color, which is an issue when we send the files off to lasercutting as the lasercutter will cut all white lines and engrave all yellow lines. In Solidworks, it was possible to set colors during export but this option is not given in Onshape.
Luckily, Onshape puts the visible sketches in a separate layer in the DXF so here's the solution:
Open the .DXF in notepad.
Search for the word “MODELSKETCH_VISIBLE” as this is the name of the layer that includes the visible sketches.
Look for the number 7 and change this to the number 2.In my case, the number to be changed was indented on the 4th line below the layer name but I don't know if this is always the case. If you want other colors, then here is a list of AutoCAD color codes: https://gohtx.com/acadcolors.php
Save the .DXF file again.
The reason for why this works is that AutoCAD (who made the DXF standard) uses 7 as the index for white lines and 2 as the index for yellow lines.
Also possibly relevant is that I save the DXF with "Release 14" selected in version.
Comments
Thanks for posting this Sebastian - solved the exact same problem I ran into today.
You're welcome. I'm happy to help others. 😄
Adding to @sebastianMaklary.
To change the color of bend lines you need to search "bend_line" and then you will need to go to result as shown in the image ( only two instances, one instance of SHEETMETAL_BEND_LINES_UP and one instance of SHEETMETAL_BEND_LINES_DOWN ) and then change 4th line which has indented 7 to 1. (1 will give you red color. Again refer to this link for color code standard
https://gohtx.com/acadcolors.php
)
.
Save the file and then you are good to go.
Open the saved .dxf file in laser cutting software and assign the layer of white lines to cutting and red lines to Mark.
Since all this DXF (and SVG as well!) coloured line thing is of a certain importance for sheet metal as well as laser cutting, it would be good if we were able to set this as a default within the respective Onshape tools. We could negotiate the colour scheme with our main sheet metal or laser shop and then just go straight away exporting happily each time! Wie geil wär' das denn?
Thanks for the feedback. This is certainly in discussion with our development team. Please submit an Improvement request and we'll add yours to our list.
This limitation among others with dxf exports led our company to completely discontinue the practice of exporting linework to dxf format for sheet metal orders. No regrets though because .step file exports have proven to be a more robust way of passing information to vendors with fewer errors. Now my only need for this feature is nicer interplay with Lightburn at home.
I will concur with Martin. It seems vitally important for sheet metal teams to be able to export SM flat patterns with colors such that etch marks, bend lines or part numbers can be decerned by the nesting/CAM software. All of the nesting/CAM software have mapping features that map a dxf pen color to a machine function.