Drawing Interchange and File Formats

AutoCAD can be used by itself as a complete drawing editor. In some applications, however, other programs must examine drawings created by AutoCAD or generate drawings to be viewed, modified, or plotted with AutoCAD. Computer generated drawings can be converted to an ASCII or binary file format for exporting AutoCAD drawings to other applications or for importing drawings from other applications.

For example, if you've made an architectural drawing with AutoCAD, using Inserted parts to represent windows, doors, and so on, you can process the drawing file and produce a bill of materials of all the items used in the drawing, or even make energy use calculations based on the area and the number and type of window used. Another possible application is to use AutoCAD to describe structures that are then sent to a large computer for finite element structural analysis. You can compute stresses and displacements and send back information to display the deformed structure as an AutoCAD drawing.

Since the AutoCAD drawing database (.DWG file) is written in a very compact format that changes significantly from time to time as new features are added, we do not document its format and do not recommend that you attempt to write programs to read it directly. To assist in interchanging drawings between AutoCAD and other programs, a "Drawing Interchange" file format (DXFTM) has been defined. A drawing exchange file (DXF) is an ASCII or binary description of the AutoCAD drawing file. It is used to share drawing data with other applications. All implementations of AutoCAD accept this format and are able to convert it to and from their internal drawing file representation.

AutoCAD also supports the Initial Graphics Exchange Standard (IGES) file format. The information comprising an AutoCAD drawing can be written out in IGES format, and IGES files can be read and converted to AutoCAD's internal format.

You can generate a drawing interchange file (DXF) from an existing drawing by means of the Drawing Editor's DXFOUT command. You can also import a drawing interchange file (DXF) by using the DXFIN command.

DXFOUT and DXFIN commands are obsolete commands in AutoCAD 2000 but can be used in script files.

DXF files are now written using the SAVE, SAVEAS, and WBLOCK commands, and can be opened and inserted into drawing files using the OPEN and INSERT commands. DXF files also have preview images associated with them. Thumbnail images are created with DXF files using the SAVE, SAVEAS, and WBLOCK commands and the images can be previewed using OPEN and INSERT.