Skip to content
Tutorials Center
My learning

Topics

Lesson 35 of 38 ยท Automation and Plotting

AutoCAD File Formats: DWG, DXF, DWT, PDF, Xrefs and eTransmit

Know AutoCAD's file types: DWG, DXF, DWT, DWS, PDF and DWF, how to save down to older versions, attach xrefs, recover damaged files, purge and audit, and package drawings with eTransmit.

Drawings travel: to a client, a contractor, a colleague using another CAD program, a plotter. Each trip needs the right format and a clean file. This lesson covers the formats you will meet, how to exchange them safely, how external references (xrefs) keep big projects manageable, and how to clean and package drawings so nothing breaks on arrival.

AutoCAD cannot run on this site. The commands are described as they work in the program, and the runnable examples are labelled JavaScript stand-ins that read a small DXF text and count entities.

Common file types

Extension What it is Use
.dwg The native drawing format Everyday work and exchange between AutoCAD users
.dxf Drawing Exchange Format, an open text (or binary) version Exchange with other CAD/CAM programs, laser cutters
.dwt Drawing template Start new drawings with layers, styles and a title block
.dws Standards file Checking layers and styles against company rules
.pdf Portable Document Format Reviews, issuing prints, with optional layer data
.dwf / .dwfx Design Web Format Lightweight reviewing and markup in Autodesk viewers
.bak, .sv$ Backup and autosave Recovery after crashes
.dst Sheet set data Sheet Set Manager projects
.sat, .step, .stl 3D exchange Solid import/export, 3D printing
.shx, .lin, .pat, .ctb, .pgp, .lsp Support files Fonts, linetypes, hatch patterns, plot styles, aliases, programs

DWG is versioned: a file made in a newer version cannot always be opened in an older one. Use Save As and choose a type such as AutoCAD 2018/LT2018 Drawing (.dwg)*; releases from 2018 onward share one format, so downsaving matters less today than it did years ago. The SAVEFILEPATH, SAVETIME (autosave minutes) and ISAVEBAK variables control backups. QSAVE saves, SAVEAS renames.

Saving and exporting

  • SAVEAS and EXPORT write DXF, PDF, DWF, STL, SAT and more. DXF settings such as Version and Precision are in the Save As > Tools > Options > DXF Options.
  • PDF plotted from a layout (see plotting) keeps vector quality; use Export > PDF for model space or the selected objects.
  • STLOUT writes solids for 3D printing; EXPORT > ACIS writes .sat.
  • Use IMPORT and DGNIMPORT to bring in other formats (STEP, IGES, Inventor, MicroStation DGN).
  • PDFIMPORT converts vector PDF geometry and text back into AutoCAD objects.

DXF structure

A DXF file is plain text made of group code / value pairs, two lines each: a number (the code) and the value. Sections come in order: HEADER, TABLES, BLOCKS, ENTITIES, and so on. In ENTITIES, a line looks like:

TEXT
  0
LINE
  8
A-WALL
 10
100.0
 20
50.0
 30
0.0
 11
400.0
 21
50.0
 31
0.0

Code 0 starts an entity and names its type, code 8 is the layer, codes 10, 20, 30 are the start X, Y, Z, and 11, 21, 31 the end. A circle uses 10/20/30 for the center and 40 for the radius. Because it is text, you can generate or inspect DXF with simple programs.

JS Stand-in: parse a tiny DXF and total the line lengths

Press Run (or Ctrl + Enter) to see the console output here.

No output.

External references (xrefs)

An xref attaches another DWG to your drawing as a live reference: the site plan on the architect's floor plan, one floor on another floor's layout. The data is not copied, so the file stays small and updates when the source changes.

  • Command: XREF (or ATTACH). Choose a file, set Reference Type: Attachment (nested xrefs also show) or Overlay (does not propagate to a drawing that references yours).
  • Path type: Relative path keeps the link when the project folder moves; Full path breaks if it moves; No path looks in the same folder.
  • Xref layers appear as xrefname|LAYERNAME; you cannot change an xref's objects directly. Use XOPEN or Edit Reference In-place (REFEDIT).
  • XBIND or Bind merges the xref into the drawing permanently; use Insert option to avoid $0$ names.
  • CLIPXREF / XCLIP trims what shows; VISRETAIN controls whether layer changes to xref layers persist.
  • The External References palette (XREF) shows the status: Loaded, Unloaded, Not Found, Unresolved. If you see Not Found, repair with -XREF > Path.

Cleaning, repairing, and sharing

  • PURGE removes unused blocks, layers, linetypes, text styles and more. Run it before sending a file.
  • OVERKILL removes duplicate and overlapping lines; AUDIT finds and fixes errors; RECOVER opens and repairs a damaged drawing; RECOVERALL also repairs xrefs.
  • SCALELISTEDIT with Reset removes unused annotation scales that bloat a file.
  • -WBLOCK with * rebuilds a drawing and often shrinks a slow file.
  • ETRANSMIT packages a drawing with its xrefs, fonts, plot styles and attached files into a ZIP or folder, so the recipient sees what you see. Choose a transmittal setup: Standard, version to save, Include fonts, Include sheet set files, and Convert drawings to a version. Always send with eTransmit rather than only the DWG.
  • ARCHIVE is the sheet set version.
  • DWGCONVERT batch-converts versions.
  • In a dispute about a layer, use LAYTRANS or STANDARDS to compare with a .dws file.
flowchart LR
  A["Working DWG"] --> B["PURGE and AUDIT"]
  B --> C["Update fields and xref paths"]
  C --> D{"Recipient needs"}
  D -- "editable" --> E["ETRANSMIT ZIP"]
  D -- "view only" --> F["PDF from layouts"]
  D -- "other CAD" --> G["DXF or STEP"]

Choose the output by what the recipient will do with it.

Common mistakes

  • Sending only the DWG when it depends on xrefs, fonts and plot styles.
  • Using absolute C:\Users\... xref paths that fail on another computer.
  • Saving DXF to share, then losing dynamic blocks, fields and annotative scales.
  • Never purging, so a 4 MB drawing grows to 60 MB.
  • Editing the .bak file directly instead of renaming it to .dwg first.
  • Forgetting that drawings can contain custom objects (from other add-ons) that appear as proxy objects elsewhere.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What kind of file is a DXF?

    DXF is an open exchange format built from group code and value pairs, typically plain text.
  2. 2. What does an Overlay xref do that an Attachment does not?

    Overlays avoid circular or nested references because they do not propagate into drawings that reference yours.
  3. 3. Which command packages a drawing with its xrefs, fonts and plot styles?

    ETRANSMIT collects all dependent files into one ZIP or folder.
  4. 4. In a DXF entity, what does group code 8 hold?

    Code 8 is the layer name; 10/20/30 hold the first point and 40 a radius or size.

Summary

  • DWG is native, DXF is a text exchange format, DWT starts new drawings, PDF and DWF share views.
  • DXF is made of group code/value pairs, easy to read or generate with a program.
  • Attach xrefs with relative paths, use overlays for nested projects, bind only when needed.
  • PURGE, AUDIT, RECOVER keep files healthy, and ETRANSMIT sends a complete package.

Next: Project: an apartment floor plan