eplisp

DWG2DXF

eplisp, the free multilingual LISP library

DWG2DXF
Openly licensed; the original file is hosted here together with its license.
…
Rate this tool:
CommandsDWG2DXFDXFCFGDXFRESETDXFPATH
CategoryData Export (Excel, CSV)
AuthorFreudsCAT
SourceFreudsCAT/dwg2dxf
LicenseMIT
Version3.5
RequirementsAutoCAD, or AutoCAD LT 2024 or later, on Windows (no ActiveX)
Prompt languageEnglish
FilesDWG2DXF.lsp (31 KB)
Added2026-10-26
Download the original fileSource repository

DWG2DXF converts every DWG in a folder and its subfolders to ASCII DXF, binding external references first; the source DWG files are never saved.

DWG2DXF is a batch conversion tool for users who must deliver many drawings as DXF or prepare files for CNC, GIS and other software that expects DXF. It handles the fact that external references cannot be carried into DXF by binding them before export.

Overview

Because AutoLISP stops running when another drawing is opened, the program does not open files itself. It builds a script (.scr) from the list of DWG files with OPEN, -XREF Bind, optional AUDIT and SAVEAS DXF steps, and runs it automatically in single-document mode (SDI). It asks for the DXF version (2018 down to R12), the xref binding mode (Insert/Bind/None) and whether to convert only new drawings or all of them.

Drawings that are open elsewhere (with a .dwl lock file) are skipped, and by default drawings whose DXF is newer than the DWG are not converted again. When the batch ends, a log file named DWG2DXF-log.txt is written in the root folder. Commands are sent in the underscore (international) form, so it is written to work on localized AutoCAD versions as well.

How to use it

  1. Load DWG2DXF.lsp with APPLOAD, ideally by adding it to the Startup Suite.
  2. Optionally run DXFPATH once to register the file's location.
  3. Make sure no drawing in the target folder is open elsewhere, then type DWG2DXF.
  4. Press Enter for the default root folder, type * for the folder browser, or paste a path.
  5. Choose the DXF version, the xref option and New/All, then confirm; the script runs automatically.
  6. If you abort with Esc, run DXFRESET to restore the variables and check DWG2DXF-log.txt.

Notes and limitations

  • Writes a .dxf with the same name next to each DWG; an existing DXF is deleted and recreated.
  • Writes a .scr and a temporary DXF in the temp folder (TEMPPREFIX) and DWG2DXF-log.txt in the root folder; DXFPATH stores the file path in the AutoCAD profile with setenv.
  • Changes variables such as FILEDIA, CMDDIA, EXPERT, SDI, ISAVEBAK and PROXYGRAPHICS during the batch and restores them at the end.
  • Warns if the current drawing has unsaved changes; if you continue, those changes are lost.
  • Raster images and PDF underlays cannot be bound and stay as external references in the DXF. Defaults can be changed in the variables at the top of the file (default DXF version 2013).
  • The repository is new (2026); try it on a copy of the drawing first.

Source and license

This tool is not made by eplisp. The file is published unchanged under its author's license; copyright stays with the author.

References

  1. Source repository: FreudsCAT/dwg2dxf – https://github.com/FreudsCAT/dwg2dxf
  2. Author: FreudsCAT – https://github.com/FreudsCAT
  3. License: MIT – https://github.com/FreudsCAT/dwg2dxf/blob/ff2cfbcb25bbc88ef83e9ed7828ec14057cff30e/LICENSE

Found a mistake, or are you the author of this tool? Request a correction or removal