Sustainability of Digital Formats: Planning for Library of Congress Collections

Introduction | Sustainability Factors | Content Categories | Format Descriptions | Contact
Format Description Categories >> Browse Alphabetical List

DWG (AutoCAD Drawing) Format Family

>> Back
Table of Contents
Format Description Properties Explanation of format description terms

Identification and description Explanation of format description terms

Full name AutoCAD Drawing file (DWG) Family
Description

DWG is the proprietary native file format for AutoCAD, one of the most popular computer-assisted design (CAD) packages. The format is maintained by AutoDesk. DWG is a compact binary format that stores and describes the content of 2D and 3D design data and metadata. AutoCAD 1.0 was released in 1982, but the origins of the DWG format are from the late 1970s, when it was the native format for a CAD package called Interact. The format has been updated frequently as the AutoCAD product has been enhanced.

As of November 2016, PRONOM has identified 19 chronological versions, none of which is publicly documented by AutoDesk. See File type signifiers below. The compilers of this resource have chosen to describe the DWG family of formats in a single document. See Notes below, for information about the chronological versions of the AutoCAD application and associated versions of the DWG format.

The syntactic structure of a DWG drawing file includes sections and section substructures. The primary substance of a drawing is in a section with name AcDb:AcDbObjects. This contains component graphical elements (known as entities) and other objects that support the editing and rendering of drawings.  Internal connections in the drawing file use identifiers for objects (including the graphical entities) known as "handles."  Objects declare their own handles and may refer to other objects via handle references. Handle references may indicate ownership or simply be pointers to other structures.  See Notes below for more on handles in DWG files. Cyclic redundancy checksums (CRC) are used extensively for error detection.

A typical DWG file will include at least the following sections:

  • Header: This section always comes first in the DWG file. The first "variable" in the header is the code used to identify the DWG format version (see File type signifiers below). Other header variables include: default units and styles for the drawing; drawing size limits; coordinate systems to use for spatial positioning; a project name; creation and modification dates and times, etc. The header also includes information needed to read and write the particular file: references to locations in the file where other sections begin; section lengths; flags to indicate how much of the file content is encrypted; and a stream of handle references to other structures. A DWG file may contain structures that are no longer used; hence the best way to interpret a file is to start from the header and trace references from there until all references have been followed. A duplicate of the header section is stored near the end of the DWG file.
  • Classes: Holds information relating to application-defined or custom classes whose instances (objects) appear in other sections.
  • Object Data:
    • Entities (graphical objects): These include simple graphical entity types such as LINE, CIRCLE, VERTEX and more complex types such as SHAPE, POLYLINE, 3DFACE, 3DSOLID, SPLINE, etc. Entity objects can include handle references for related objects, including child ("owned") objects and parent ("owner") objects.
    • Non-graphical objects: These include dictionaries, settings, etc. that support the drawing and rendering functions in a CAD application.
  • Object Map (Handles): A table which gives the location of each object in the file, listing all handle identifiers and the corresponding location in the file by an offset into the into the AcDb:AcDbObjects section.

See Notes below for more sections and object types that might occur in DWG files.

Production phase Used primarily for creation of design drawings and models and as master format for deriving renderings in two or three dimensions. In the domain of architecture, used for collaboration among architects and engineers designing, constructing, and maintaining buildings.
Relationship to other formats
    Other DXF_ASCII_Family, DXF (AutoCAD Drawing Exchange Format) Family, ASCII variant. Originally designed to be an ASCII equivalent to DWG. For many situations, the DXF format can still contain all the information in a source DWG file. See Notes below on relationship between DWG and DXF_ASCII.
    Other DWF (Design Web Format) and DWFX, proprietary formats from AutoDesk for publishing designs for review, not described separately on this website. See Notes below on related publishing formats from AutoDesk.

Local use Explanation of format description terms

LC experience or existing holdings  
LC preference Among vector graphics formats, the Library of Congress has expressed a preference for the AutoCAD Drawing Interchange Format (DXF). Widely used proprietary formats are acceptable if needed to be a faithful representation of a work. See Recommended Formats Statement: Still Image Works.

Sustainability factors Explanation of format description terms

Disclosure

The DWG format is a proprietary format developed and maintained by AutoDesk. No specification has been published by AutoDesk.

    Documentation

The conceptual and semantic aspects of the DWG drawing format are covered best in the documentation AutoDesk supplies for the DXF Drawing Interchange Format in its help system [About the DXF Format | AutoCAD 2017].

The closest thing to a specification for the syntax of DWG files is the Open Design Specification for .dwg files, derived by the Open Design Alliance (ODA) by reverse engineering. As of November 2016, this document covers the DWG format from AutoCAD Release 13 through AutoCAD 2013 (AC1027). The AC1027 version of DWG has been used from AutoCAD 2013 through AutoCAD 2017. The ODA is an organization of over 1,000 firms that support the development of the Teigha toolkit to allow members to read and write files in DWG and other formats.

Adoption

The DWG format is very widely used. It is the native format for AutoCAD and other AutoDesk products. According to a blog post at In The Fold, AutoCAD scored top marks in a Winter 2015 rating for General-Purpose CAD. Is BricsCAD A Real Alternative to AutoCAD?, a blog post from April 28, 2015, indicates, "Products competitive to AutoCAD have come and gone over the years. None appear to have the critical functionality and the supporting infrastructure to cause established AutoCAD users to risk the switch." The post goes on to suggest that 100% DWG compatibility is the most important factor in considering alternative products. CAD applications that use DWG as the native format include: products based on the IntelliCAD Technology Consortium platform, such as CMS Intellicad; products based on the Open Design Alliance platform Teigha, such as Caddie, BricsCAD, DraftSight, and NanoCAD; and CADKON+. See Wikipedia's Comparison of Computer-aided Design Editors for information about support for DWG in many other CAD applications.

RealDWG is a software development kit (SDK) supported and used by AutoDesk and available for license from Tech Soft 3D. Source code for the Open Design Alliance's Teigha Kernel, Drawings, and other modules are available to ODA's founding and corporate subscribers. ODA's Teigha Drawings code is based on software libraries previously known as OpenDWG and DWGdirect. Source code for the core IntelliCAD software is available to commercial members of the IntelliCAD Technology Consortium (ITC). However, the code used to read and write DWG files is the same for both consortia. ITC is a member of ODA (see The ITC and the ODA: Complete opensource CAD solution). According to ITC President, David Lorenzo, "The ITC has based IntelliCAD development on the ODA libraries since its inception, and we know they will deliver the core technology required for our open source CAD engine to support any new .dwg or .dgn file formats in the future." The description of the Teigha or ITC code-bases as "open source" has been questioned, for example in the Talk page on Wikipedia entry for IntelliCAD.

Open-source projects that aim to read and write DWG files include: LibreDWG (a C library to handle DWG files) and LibreCAD (an open-source 2D CAD application based on Qt, previously known as QCad then CADuntu). However, it appears that developing and supporting CAD applications may demand more effort and expertise than free open-source projects can maintain over the long term. In February 2016, a message in a discussion thread in the libredwg mail list with subject "Looking for new maintainers" includes the paragraph from one of the project leaders, "Maybe it is a good time to discuss the future of this project. LibreCAD have implemented libdxfrw with DXF-rw (obviously) and DWG-r, apparently at a better stage than LibreDWG. Licenses were incompatible so they just hacked it themselves." And, in May 2016, the LibreCAD blog announced the departure from the team of "a very valuable asset."

There are a number of free or inexpensive applications that can be used to view DWG drawing files, including: the Teigha Viewer; DraftSight a free CAD application; the eDrawings app for iOS and Android; and several viewers from AutoDesk, including the online A360 viewer, DWG TrueView, and the AutoCAD 360 app for mobile devices.

Several archival organizations have listed DWG as preferred or acceptable for depositing or storing CAD drawings: Harvard Digital Repository Service, Library and Archives Canada, the UK Data Archive, UK Archaeology Data Service, and National Archives of Australia.

    Licensing and patents

AutoDesk and partner Tech Soft 3D make available, via license, RealDWG, a Software Development Kit (SDK) for reading and writing DWG files.

As detailed in the section on AutoDesk Trademark in the Wikipedia entry for .dwg, AutoDesk has attempted to use trademark law to retain control of the format. In 2006, AutoDesk sued the Open Design Alliance, "alleging that its DWGdirect libraries infringed Autodesk's trademark for the word 'Autodesk', by writing the TrustedDWG watermark (including the word 'AutoCAD') into DWG files it created." The issue was settled in 2007.

Transparency

This proprietary binary format is not transparent. ODA's attempt at reverse-engineering, Open Design Specification for .dwg files, demonstrates the degree to which developing code to interpret DWG files would be difficult. The need to conserve space in the early days led to techniques to save bits that would obscure the structure. Structure and semantics are conveyed through numeric "group codes," not by human-readable tags. New group codes can be introduced without documentation.

Self-documentation

Metadata may be embedded in a DWG file. Sections in the DWG file that maybe used include Summary Info, Revision History, and AppInfo (information about the creating information). The compilers of this resource have not ascertained how widely these capabilities are used. Comments welcome.

External dependencies

None beyond software that can interpret DWG files in general, and more specifically, the types of objects and entities included, some of which may be specific to the applications used in the creation of the file.

Technical protection considerations

The DWG format supports encryption of much of the file's content. Some DWG files may have been saved with a password using an internal mechanism, but this capability has been eliminated starting with AutoCAD 2016. AutoDesk now recommends the use of any encryption product that meets current industry standards and is updated as needed.


Quality and functionality factors Explanation of format description terms

Still Image
Normal rendering Good support.
Clarity (high image resolution) Scalable.
Color maintenance Color specification in DWG is by indexed palettes or True Color (RGB color space, 24-bit depth). See About Setting the Color of Objects from AutoCAD Help.
Support for vector graphics, including graphic effects and typography Excellent support for vector graphics. More than 60 types of geometric objects are defined, as well as grouping of objects as Blocks or in Layers.
Support for multispectral bands Not applicable.
Functionality beyond normal rendering

Support for 3D models as well as 2D drawings. Support for multiple viewports and geospatial positioning.

Other
Support for CAD/CAM/CAE

Excellent support for 2D drawings. Support for some 3D model types. AutoCAD's native method for 3D modeling is based on a polymesh construct that uses 3D FACEs. ACIS solids can also be embedded in a DWG file. See Notes below on 3D Objects in DWG files.

According to Wikipedia's Comparison of Computer-aided Design Editors, AutoCAD supports BIM (Building Information Modelling) and IFC (Industry Foundation Classes) for some "verticals." However, it is unclear to the compilers of this resource whether BIM data would ever be stored in a DWG file. Comments welcome.


File type signifiers and format identifiers Explanation of format description terms

Tag Value Note
Filename extension dwg
Closely related files use the same format structure: .bak (for drawing backup), .dws (for drawing standards), .dwt (for drawing templates) and .sv$ (temporary automatic save) files are also DWG files.
Internet Media Type image/vnd.dwg
See registration correspondence at IANA.
Magic numbers Hex: 41 43 31 30
ASCII: AC10
These four bytes act as magic numbers for DWG files created by AutoCAD versions since 2.5 (released June 1986). Versions 1.2-2.22 (AutoCAD releases April 1983-early 1986) have ASCII "AC" as the first two bytes. AutoCAD 1.0 used "MC0.0" as the first five bytes of DWG files. See History notes.
Indicator for profile, level, version, etc. See note.  The first six bytes of a DWG file indicate the version of the format. See signifier row for magic numbers above, and History notes.
Pronom PUID See note.  As of November 2016, PRONOM had assigned 19 PUIDs to different chronological versions of the DWG format, the most recent being fmt/531 for the version of the format used for AutoCAD 2013 through AutoCAD 2017 (the current version as of November 2016).
Wikidata Title ID Q1053358
See https://www.wikidata.org/wiki/Q1053358.

Notes Explanation of format description terms

General

Additional sections and object types: Additional features that may be present in DWG files include:

  • SummaryInfo: This optional section contains metadata. Pre-defined properties include Title, Subject, Author, Keywords, Creation date/time, Modification date/time. The section can also contain other properties, represented as key/value pairs. Other metadata sections include RevisionHistory, AppInfo (about the creating application), and Preview (a BMP or WMF thumbnail image to represent the DWG file in directory displays).
  • Blocks: In AutoCAD, a "block" is a collection of objects that are combined into a single named object. Blocks are often created as independent drawing files and then inserted; libraries of blocks are made available by part suppliers. Named blocks may not be recognized by all CAD software, even if the component objects are.
  • Layers: In AutoCAD, layers provide a mechanism for organizing objects in a drawing by function or purpose. Layers can be turned on and off to reduce the visual complexity of a drawing and improve display performance. For example, a building plan might have layers for doors and for electrical wiring.
  • Image data: Raster images can be stored in a DWG file along with clipping boundaries to use when embedded in the drawing.
  • Data storage: This section (aka AcDsPrototype_1b) was introduced for AutoCAD 2013. Standard ACIS Binary (SAB) and Standard ACIS Text (SAT) data for REGIONs and 3DSOLIDs are stored in this section. In other contexts these bytestreams may be independent files with extensions .sab and .sat. ACIS is a solid modelling geometric engine incorporated into many CAD packages. See Wikipedia entry for ACIS. This feature may also be used to store arbitrary "blobs" (binary large objects) in a DWG file. According to articles from Design Engineering in March 18, 2016 and December 13, 2016, BricsCAD from Bricsys packs all its data (including other 3D data and BIM data) into its DWG files. A more technical blog post by the same author, Ralph Grabowski, Betting on DWG for an Entire Ecosystem, describes the Bricsys approach in more detail, making it clear that it involves use not only of extensibility in the DWG format but also the use of extensions to the AutoDesk APIs. A 2012 Member showcase featuring Bricsys from the Open Design Alliance indicates that Bricsys uses ODA's TEIGHA libraries and contributes enhancements and bug fixes back to ODA. ARES CAD software from Graebert is also DWG-based, also using TEIGHA libraries, and presumably takes advantage of this feature which introduces the potential for interoperability problems when software other than the application that created the DWG file is used to read or render it. Comments welcome.

Error detection and correction: The DWG format makes extensive use of Cyclic Redundancy Checks (CRC) to support error detection. The version with code AC1021 (introduced in AutoCAD 2007) also uses Reed-Solomon encoding to support error correction. However, this mechanism was dropped in subsequent versions (AC1024, AC1027).

Handles in DWG files: Objects in DWG files are referred to by object "handles." The syntax for these handle references comprises: a 4-bit code for handle type; a 4-bit counter for the length in bytes of the handle; followed by the handle itself. The type codes distinguish between references that indicate an object directly and those that are expressed as an offset to another handle. The type codes for direct references divide handles into four categories:

  • Soft ownership reference: the owner does not need the owned object. The owned object cannot exist by itself.
  • Hard ownership reference: the owner needs the owned object. The owned object cannot exist by itself.
  • Soft pointer reference: the referencing object does not need the referenced object and vice versa.
  • Hard pointer reference: the referencing object needs the referenced object, but both are owned by another object.

Note: This use of the term "handle" is not related to the Handle System, introduced in 1995 to manage persistent identifiers for digital objects.

3D objects in DWG files: AutoCAD was originally focused on a digital equivalent of drawings on paper but has steadily added 3D modeling features. For example, a blog post from AutoDesk on AutoCAD 2010 and 3D highlights new features. The post discusses AutoCAD 2010 features that support two technical forms of 3D representation: meshes and solids. Both types of 3D model can be stored in a DWG file (starting at least from AC1024): Polymesh objects (also referred to as polyface meshes) are constructed from POLYLINE objects, which connect vertices; 3DSOLID and BODY objects hold 3D content in a form that allows solids to be hollowed out or surfaces to have thickness. The documentation for dxfgrabber indicates that the content of 3DSOLID and BODY have typically been ACIS solid models in SAT (Standard ACIS Text) form, but that since AutoCAD 2013 (AC1027), AutoCAD has stored ACIS data as SAB (Standard ACIS binary). The AutoDesk documentation does not mention ACIS by name, but indicates that the content of 3DSOLID is of type "AcDbModelerGeometry" with modeler format version (currently 1) and a number of lines of proprietary data. Judging from the DXF documentation available online, the 3DSOLID object was introduced with Release 13 of AutoCAD around 1995. The reverse-engineered Open Design Specification for DWG describes these ACIS 3D objects in clause 19.4.39 and chapter 23, indicating that embedded SAB data is preceded by "ACIS BinaryFile" in ASCII and followed by "End\x0E\x02of\x0E\x04ACIS\x0D\x04data".

Relationship of DXF and DWG: AutoCAD's Save Drawing As command offers the option of DWG and DXF formats. The usual DXF file is a transparent ASCII text file, often recommended for interchange and preservation for this reason. See DXF_ASCII. An equivalent binary DXF format is also defined; it is almost always described as "DXF Binary" or "Binary DXF". DXF_Binary is not described separately on this website.

According to a slideshow comparison of DWG and DXF from Scan2CAD, "The DXF file format was created at the same time as DWG (1982) and by the same company – Autodesk. The DXF file format was developed to provide an exact representation of the data in the AutoCAD’s native file format, DWG." However, AutoCAD has added and enhanced many features, some of which include embedding data not easily incorporated into a text file. For example, the current DWG format includes the ability to embed Standard ACIS Binary (SAB) data and arbitrary blobs in the AcDsPrototype_1b section. The compilers of this resource have not been able to determine the degree to which the full semantic and functional content of all DWG files can be represented in DXF_ASCII files saved as DXF within AutoCAD. Comments welcome, particularly to identify content that may be held in a DWG file but would be either omitted or significantly changed when a DXF_ASCII file is written out.

Statements about potential differences between the content of a DWG drawing and a corresponding DXF representation include:

Conversion of DWG to DXF using tools that are not based on the RealDWG SDK used within AutoCAD may have different shortcomings. Comments welcome.

A separate issue is numerical precision. Conversion of numeric values represented in floating-point binary to ASCII characters always has the potential for loss of accuracy. This is mentioned in the DXF documentation from AutoDesk by the statement, "Unlike ASCII DXF files, which entail a trade-off between size and floating-point accuracy, binary DXF files preserve the accuracy in the drawing database." However, in many circumstances the difference will not be significant, as indicated in the help for options for the AutoCad Save As DXF command, "The default precision is usually adequate; however, you might need to increase this value for certain drawings or applications."

Related publishing formats from AutoDesk: Two proprietary formats with limited functionality have been developed by AutoDesk for publishing designs. DWF and DWFx are secure file formats developed to combine and publish rich 2D- and 3D-design data. They are highly compressed file formats suitable for distributing a single drawing or multiple drawings and sheet sets over the Internet for review by people without a CAD application. AutoDesk provides a free application, Autodesk Design Review, for this purpose. DWFx is a relatively new version of the DWF file format, based on Microsoft's XML Paper Specification (XPS). DWFX documents can be viewed and printed with the Microsoft XPS Viewer, distributed as part of the Windows operating system. See About DWF and DWFx Files.

History

The precursor to AutoCAD was Interact, written by Mike Riddle for early microcomputers, starting in 1977, and released as a product in 1979 for a system based on a Marinchip 9900 CPU, which had hardware multiplication. In 1981, Riddle and the principals of Marinchip Systems, John Walker and Dan Drake, joined about a dozen other people to found AutoDesk and rewrite the software for the IBM PC. See Mike Riddle's Prehistoric AutoCAD and interviews in 2005 with Mike Riddle from the Digibarn Computer Museum. The highly compressed form of the DWG format has its origins in the early days of personal computers.

AutoDesk released AutoCad 1.0 in December 1982. A chronology of AutoCAD software releases is at AutoCAD Release History; a section on DWG File History lists version codes for the DWG format. See How to find the format of a DWG or which version of AutoCAD was used to create/save a DWG for an explanation of how DWG version codes and AutoCAD release identifiers are stored in DWG files in the initial bytes in the file (readable as ASCII or Hex characters even though the file content is mainly in a compact binary form). New DWG versions have been introduced roughly every two or three years since 1990. The Wikipedia article for the DWG format also lists version codes back through version 1.0.


Format specifications Explanation of format description terms


Useful references

URLs


Last Updated: Monday, 27-Feb-2017 09:55:21 EST