DXF file - structure and shortcomings of the Drawing Interchange File Format


The Drawing Interchange Format (file extension .dxf), the so-called DXF file, is a file format developed by Autodesk in the early 1980s. It is used for the cross-platform exchange of CAD drawings. The DXF file extension was chosen to reliably distinguish the format from the spreadsheet format DIF. Practically all CAD and CNC programs in use today support the DXF format for the exchange of data. When using it, however, it should be noted that the format has a number of shortcomings that make it difficult to transport designs over it.

History of the DXF format

After AutoCAD was first released as a program for MS-DOS in the early 1980s, the company behind it, Autodesk, soon developed ports for Macintosh and Unix systems as well. The different versions of the software did not work completely the same, especially concerning the storage of the data. Therefore, the development of the Drawing Interchange Format became necessary to ensure compatibility between the different AutoCAD versions. Although Autodesk did not specify the file format publicly at first, developers of alternative CAD programs soon supported it. With the release 14 of AutoCAD in 1997, support for Mac and Unix was discontinued. However, the DXF file was continued by Autodesk, as the format had proven its worth for interchange with other software vendors' programs. DXF relies on a vector-based description of geometric primitives. By recombining them, even more complex shapes can be represented. With DXF one can store 2D and also 3D drawings.

In contrast to the AutoCAD-native DWG format, DXF does not support all CAD functions and is structured in such a way that important information is sometimes lost. For this reason, the file format is often described as the "lowest common denominator" of the various CAD applications. With DXF, only basic features of the programs can be used, but the standard is available program-independently.

Shortcomings of the DXF format

Despite the self-declared claim to be able to transfer CAD information cleanly from one program to another, the porting of data via the DXF format usually requires repairs. One of the biggest shortcomings of the DXF format is the so-called dimensionlessness of the format. Since there are internationally the most different notations for dimensions, the format renounces to store these also into the file. However, this only preserves the size relations of the objects to each other. Common DXF import modules therefore typically offer the option of subsequently entering the dimensions used so that they can also be used in the new CAD program. Since this usually has to be done manually, porting data via the DXF format is usually very time-consuming.

In addition, DXF does not offer support for font files. Autodesk offers some vector-based fonts that can be saved directly in DXF format. However, direct porting of system fonts used in the creation of a CAD design is not possible. In addition, DXF does not support different line weights and hatchings. Both can be translated into DXF-supported primitives using modern export functions. The import into another program, however, often proves to be extremely complex. Line thicknesses are often coded as line colors instead. Since many CAD programs now also support Autodesk's own DWG format, it can make sense to use it for porting data. However, unlike DXF, the specifications of the DWG format are not open.

Structure of a DXF file

DXF files are usually stored as plain text readable and editable ASCII files. The files consist of several, clearly separated blocks, which are marked by keywords

  • The first block is the HEADER of the file, which stores meta-information about the saved drawing. This includes information such as the required pen assignment in a plotter. 
  • This is followed by the CLASSES area. It is actually intended to store data about defined libraries of the exporting software. However, this block is rarely used. The reason for this is that the possibilities of the CLASSES block are very limited and a meaningful definition of most concepts generated by modern CAD programs is hardly possible over it. 
  • This is followed by the TABLES section, where clear specifications of elements such as colors and line widths are stored. 
  • In the BLOCKS section of the file one defines the logic of the layout. The geometric units defined in the following ENTITIES block are logically summarized here. 
  • In this ENTITIES block the actual vector information for the drawing is stored. The vectors are defined in the form of floating point numbers (floats). The logical elements, in turn, are numbered using integers and thus made uniquely addressable. 

Many CAD programs and import modules only read the ENTITIES block of the DXF files. This further increases the problem of incorrectly ported DXF files. Further blocks follow, in which one can store objects in script languages like AutoLISP or Thumbnails. In practice, neither the OBJECTS nor the THUMBNAILS block play a major role. Finally, the END OF FILE command tells the DXF parser that the file ends and no further information can be read.

Frequently asked questions (FAQ) about DXF files

What is a DXF file?

The DXF file is a file format developed by Autodesk and stands for "Drawing Interchange Format" (file extension .dxf). It is used for the cross-platform exchange of CAD drawings. Practically all CAD and CNC programs in use today support the DXF format for the exchange of data.

How do I create a DXF file?

DXF files can be output by almost any CAD program and can also be read in again. In addition, there is the possibility to create DXF files via online conversion tools. This is useful if a CAD file is in an exotic format and cannot be read, but it is also very error-prone. However, especially the conversion DWG to DXF works very well via such online tools.

How can I open a DXF file?

Pretty much every CAD program can open DXF files. So nothing stands in the way of using it, regardless of the operating system used. Even pure viewing programs like DWG TrueView often support the reading of DXF files. A special importance for the DXF format has still the program AutoCAD. New DXF format versions are usually aligned with the AutoCAD release cycle.

Is DXF a 3-D format?

DXF files can contain blueprints for two- and three-dimensional objects. Many editors and viewing programs can render and display 3-D objects directly from a DXF file. This is useful not least to check whether the DXF file contains gross errors. If an object cannot be fully rendered, there is probably a formatting problem.

Is the DXF format better than DWG?

It is difficult to give a blanket answer to the question of whether DXF is better than DWG. Both formats have their advantages and disadvantages. However, those who work with AutoCAD will typically prefer to save in DWG format. For interoperability with other applications, DXF seems at first glance to be the more suitable format. The clear format definitions help to create easily readable files, while DWG files can only be read in by alternative programs with the help of replicated import functions. In many cases, however, this now works better than the detour via the DXF format. In particular, many CAD programs can now read in less complex designs as DWG files.

Weitere Begriffe