DXF files – import / export / edit

Important: To import / export dxf files you need to install dxf-library. In version 0.17, use Addon manager. From the Freecad main menu click Tools → Addon manager and choose dxf-library, install and restart program. For older versions of the program, the manual is here: https://www.freecadweb.org/wiki/Dxf_Importer_Install

In this lesson we will show how to import and export dxf files to / from Freecad and we will demonstrate the possibilities of editing created drawings.

First, We create a simple dxf file in LibreCAD. It will be 3 different layers (layer_1, layer_2, layer_3). In each layer, we will create some one or several sample, uncomplicated geometry.

Then we import the created file by choosing File->Import from the Freecad main menu.

Our geometry has been imported in the form of Draft workbench objects and we can edit it directly with the functions of this workbench. It is worth paying attention, geometry is transferred in the form of groups in the project tree.

The video shows an example of a modification lines -> wire -> face -> solid using the upgrade (Draft) extrude (Part) functions.

The imported geometry can also be transformed into a sketch using the Draft to Sketch function (Draft) . It is worth noting that the created sketch is black (white is default for sketches). Of course, sketches can be freely modified using sketcher Tools. The video shows an example of extruding sketch and rounding the 2 edges of the created solid.

Note: A single sketch can only be created from one object, which can be somewhat uncomfortable and not very practical. In order to create “bigger” sketches, first of all, combine draft objects into one using boolean union function (Part) and then Draft to Sketch (Draft) function.

In the example of file export, we will use a solid created from the difference of a hexagonal prism and a cone. The projections were created using the Shape 2D View (Draft) function. In addition, we have created two sections to present the interior of the solid. The move and rotate functions were used to arrange projections on the plane.

Note: It is important that all imported objects to the dxf file are on one plane or on parallel planes

To export objects to a dxf file, select them in the project tree, and then click File ->Export from the Freecad main menu.

Selected sketch can also be exported to a dxf file. The video also shows an example sketch and its export.

Note: The elements of the dxf file are grouped into blocks according to the draft objects (in the case of a sketch it will be one large block). To get editable geometry (individual elements), use the explode function.