Overview of a .dxf file:
A DXF file format is also known as AutoCAD Drawing Interchange File, and it is an exchange format for drawing files containing tagged data generated by Autodesk AutoCAD. DXF file format enables for CAD data file compatibility between AutoCAD and other programs. According to the DXF file format compatibility guidelines, data may thus be imported from different formats to DXF for AutoCAD. Another common file format .dwg, can be saved as a .dxf for importing into other programs.
Three essential parts of a CAD-generated drawings that we focus on for the purposes of DXF file clean up are Layers, Blocks, and Hatches. Descriptions and examples of each part are provided below.
Please note that there is a limit of 5mb for the file size for import to drawing.tool. For files larger than 5mb, we recommend that user(s) follow the clean-up steps at the end of this article to facilitate the import process.
In a .dxf or .dwg file, layers are ways to organize and separate elements of a drawing and provide a way to control the visibility of entities. In addition to organizing elements of a drawing, layers can be used to convey and segregate drawing conventions by type (such as lines, tags, callouts), lightweights, and other characteristics. The images below, courtesy of Autodesk, shows an example of how layers can be organized and how they can be used to depict different elements of a drawing in a working CAD file.
A block in a .dxf or .dwg file represents an assembly or grouping of drawing elements. As an example, a block can represent a series of lines drawn to visually represent a piece of furniture or assembly in a CAD drawing. The image below, courtesy of Autodesk, shows an example of blocks that users can create and use repeatedly throughout drawing(s).
The hatch command is used to add pattern to an enclosed geometry, often to represent a material. The image below, courtesy of Autodesk, shows examples of hatch patterns and how it is applied in a CAD-generated drawing.
Tips to Clean up a .dxf file for import
Export from AutoCAD:
Select > File > Save As > Other formats (dwg, dxf)
Open the DXF options tab and select ASCII solids format.
Choose the Select objects checkbox:
Controls whether the DXF file consists of selected objects or the entire drawing. When the output file includes only selected objects, the block definitions of only the selected block references are included.
Make sure to hide :
In AutoCAD drawing canvas, select the Objects to Export to DXF hit Enter.
Example of a clean .dxf file
Steps to clean .dxf from Rhino
In Rhino, go to File > Import > Choose AutoCAD Drawing Exchange (*.dxf) and select the file to import.
Choose the appropriate Model units and other settings from the dialog box and click OK.
Use commands like "SelDupAll" to select all duplicate lines and delete at once.
"SelHatch" to select all Hatch Patterns and delete at once.
Once all the details have been removed, select all the lines > go to File > Save As > from the Save dialog box > Set Save as type to AutoCAD Drawing Exchange (*.dxf) > Set as Solids > OK