About AutoCAD Files

There are two formats used by AutoCAD: DXF (drawing exchange format) files, which are large; and ASCII representations of the binary DWG (drawing) files. Logically, both files are identical and, therefore, FME treats both file types in the same manner.

For AutoCAD DWF reading and writing support, please see the Autodesk AutoCAD DWF Reader/Writer

AutoCAD files consist of sections, as follows:

  • HEADER: This contains settings of variables associated with the drawing.
  • CLASSES: This contains class definitions associated with the drawing.
  • TABLES: This contains a variety of tables, including:
  1. Layers: Each layer entry contains layer definition information such as layer color, layer name, and layer linetype. The AutoCAD reader validates the layer names and may modify them to remove invalid characters.
  2. Linetypes: Each linetype entry contains the linetype definition information such as name and alignment. The AutoCAD writer enables linetype definitions to be copied from an existing AutoCAD file, then referenced by name during the data translation.
  3. Shape Files: Each shape file entry identifies a shape file referenced by the drawing. Shape files are used by AutoCAD as a different method for defining symbols or fonts. Note: These are similar to the TextStyles in AutoCAD.
Note  AutoCAD shape files are not the same thing as Esri Shapefiles. AutoCAD shape files store symbol and font definitions.
  1. Applications: Each application entry contains the name of an application referenced within the AutoCAD file.
  • BLOCKS: These are used to define symbols and other drawing file objects used repeatedly throughout a drawing. The AutoCAD writer enables copying of block definitions from an existing AutoCAD file, which is then referenced by name during a data translation operation.
  • ENTITIES: This is the main section of a drawing file and contains the actual feature entities. Each entity contains standard information, such as its color, layer, linestyle, and geometry, as well as a number of attributes specific to its entity type. For example, all 2D entities have thickness, while a text entity has fields for font, size, and the text string in addition to the standard display attributes.

FME supports both 2D and 3D AutoCAD entities. However, many applications only support 2D DWG and DXF files. The 2DForcer transformer can be used to ensure that only 2D data is written to an output DWG or DXF file.

OBJECTS: This section stores dictionaries and other helper non-entity objects.

Each entity may also have associated attribution stored within an extended entity data section. FME supports reading and writing of extended entity data.

Each entity may also have associated attribution stored within XRecord objects in an extension dictionary section. FME supports reading and writing XRecord data from entities.

All coordinates within a drawing file are stored as 64-bit floating point values in world coordinates. As such, there is no need to scale or otherwise alter coordinates as they are being read from or written to a drawing file.