• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
blog.draftsperson.net

blog.draftsperson.net

the art of technical drawing

blog.draftsperson.net

XREFREVERT LISP: Reset Xref Layer Overrides From Source

August 3, 2026

When you attach an xref, its layers appear in your drawing as XREFNAME|LayerName and you can change their colour, linetype, visibility and so on locally. Those local changes override the source. Over a long job that accumulates until nobody can remember which properties are the consultant’s and which are somebody’s local fiddling.

What XrefRevert does

XREFREVERT reads the properties straight out of the source drawing file and writes them back over the local overrides.

At the prompt you can pick an xref to reset that one, choose Multiple to window-select several, All for every xref in the drawing, or Settings to choose which properties get reset.

The Settings dialog covers colour, linetype, lineweight, plot, plot style, frozen-in-viewport, on, locked, frozen and description. Your choice is remembered between sessions, so you can reset colour alone and leave your own visibility settings intact — which is usually exactly what you want, since freezing an xref layer is a legitimate local decision and recolouring it often is not.

How to use it

  1. Load the routine with APPLOAD, or put it on your support file search path.
  2. Type XREFREVERT.
  3. Choose Settings first and tick only the properties you want reset.
  4. Pick an xref, or choose Multiple or All.

How it works

The source drawing is opened through ObjectDBX, which reads a DWG without opening it in the editor — so this works across dozens of xrefs in seconds and without disturbing the drawing you are in.

If an xref is already open in this AutoCAD session, the live document is used instead. That matters twice over: ObjectDBX cannot open a file that is locked by the editor, and using the live document also means unsaved changes in that drawing are picked up rather than being invisible.

If the source cannot be found at its recorded path, the support file search path is tried before giving up — which covers the common case of a project that has been moved or copied to a different machine.

Notes and limits

  • Set the properties before running it. Resetting everything will undo deliberate local visibility decisions along with the accidental ones.
  • Your property choice persists between sessions.
  • Unsaved changes in an open xref are used, since the live document is read.
  • One undo group covers the reset.

Download and details

NameXrefRevert — reset xref layer overrides back to the source drawing
DownloadXrefRevert.lsp — 22.0 KB, plain AutoLISP source. Downloads directly; no zip to unpack.
TypeAutoCAD AutoLISP routine
CommandXREFREVERT
Requiresthe ActiveX layer (loaded automatically by the routine with vl-load-com); nothing extra — the dialog is written to a temporary file at run time and deleted again, so there is no .dcl to install.
Source size22.0 KB, 532 lines
Error handlingYes — a *error* handler restores every system variable it changed, on cancel as well as on error.
UndoThe whole operation is wrapped in a single undo group, so one U reverses all of it.
CompatibilityAutoCAD (any release with AutoLISP), BricsCAD, ZWCAD, GstarCAD, ProgeCAD and other IntelliCAD-based platforms. AutoCAD LT needs a LISP enabler. No .NET, no ObjectARX, no installer.
AuthorYZ, August 2026
LicenceFree to use, supplied “as is” with no warranty.

References

  • LAYERHARVEST LISP — audit layer properties across a folder of drawings
  • BORROW LISP — import layer definitions from another drawing
  • LAYWRAP LISP — prefixing layer names when merging drawings
  • More free AutoLISP routines on this site
  • Wisey’s Steel Shapes — free structural steel section drawing program

Filed Under: AutoLISP Routines

Primary Sidebar

Subscribe to our Youtube Channel

Post CAD drafting jobs on Freelancer.com. and get some free money to do this.

Categories

  • American Steel Industry (4)
  • AutoCAD Articles & Reference (30)
  • AutoCAD Bugs & Problems (19)
  • AutoCAD Tips (29)
  • AutoCAD Tutorials (54)
  • AutoLISP Routines (328)
  • AutoLISP Tutorials (15)
  • CAD Standards (7)
  • Civil 3D (7)
  • Civil Drafting (4)
  • Dimensions (2)
  • Drafting Funnies (71)
  • Drafting History (9)
  • Drafting Standards (84)
  • Electrical Drafting (2)
  • General IT reference (7)
  • Geometry (15)
  • GIS (2)
  • Hatch Patterns (12)
  • Office Life Hacks (3)
  • PT (1)
  • Revit Tutorials (54)
  • Steel Detailing (14)
  • Structural Drafting (26)
  • Technical Dictionary (61)
  • Useful Website Links (19)

Footer

Free downloads

  • Free AutoLISP routines
  • Free hatch patterns
  • SHX fonts & text styles
  • Numbering LISP collection
  • ISO 3098B font

Reference charts

  • AWS weld symbols chart
  • Steel detailing chart
  • Hole & slot sizes
  • Bolt edge distance
  • ANSI & ARCH paper sizes
  • How to fold an A1 drawing

Useful links

  • CAD blocks (DWG)
  • Revit families
  • structuraldrafter.com
  • cad-corner.com
  • About
  • Privacy policy

Provided for free with no warranty · Log in