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
- Load the routine with
APPLOAD, or put it on your support file search path. - Type
XREFREVERT. - Choose Settings first and tick only the properties you want reset.
- 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
| Name | XrefRevert — reset xref layer overrides back to the source drawing |
| Download | XrefRevert.lsp — 22.0 KB, plain AutoLISP source. Downloads directly; no zip to unpack. |
| Type | AutoCAD AutoLISP routine |
| Command | XREFREVERT |
| Requires | the 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 size | 22.0 KB, 532 lines |
| Error handling | Yes — a *error* handler restores every system variable it changed, on cancel as well as on error. |
| Undo | The whole operation is wrapped in a single undo group, so one U reverses all of it. |
| Compatibility | AutoCAD (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. |
| Author | YZ, August 2026 |
| Licence | Free 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