This website is made for modern browsers. You are seeing this, because your browser is missing a feature or two. Please install the latest update or switch to a modern browser. See you soon.

Export to DXF


This code snippet will help you to export lines and meshes from Grasshopper to a *.dxf file. The restriction to lines and meshes is intentional and you can tweak the script to export other types of geometric objects as well.

The purpose of this setup is to export a file that contains structural elements that can be loaded by FEM software. Here, only lines and meshes are allowed and thus this restriction makes us aware of any wrong geometry types before we export. You can download the file at the bottom of this page and look at the code if you like. Now, we see how to use it.

The first inputs on the main component let you set a directory (by default it’s your desktop) and a filename. At input S you could provide the name of an export scheme, for example R12 Lines & Arcs. The names of the schemes will change if your instance of Rhino is not in English. You can set the unit for the DXF file with the drop-down selector at input U. The Toggle at input Go will trigger the export and reset after 20 seconds. The Panel will state a success or warning.

Your lines and meshes go into the smaller components. You can also set the layer name for each line or mesh. Your layer name will typically also be transferred to the software that reads the DXF file and you can pass some valuable information this way. If you are, for example, using Dlubal RStab, the name of the layer will become the name of the cross section.

Example setup. The first branch of lines will be in the layer named by the first item, and so forth.

Behind the scenes, these components will bake your geometry to Rhino, then export a DXF file through the Rhino interface and remove the geometry from Rhino. If your computer is slow and you are exporting a large amount of data, you might need to increase the timer.

Get the results

Version Info

  • Rhino 6.30
  • Grasshopper 1.0.0007
This page is open source. Edit it on GitHub or see how you can contribute.

Up next