[Search tip detail and code files using keywords, tip number, author name, etc ]
    For tip to function correctly, you must ensure that the downloaded file name matches the file name
    displayed in the Rename File To field. Please rename downloaded files when necessary.
X On, X Off
Tip# 3762 By Samuel Lucido On 23-Oct-2011
Rated By 0 users Downloaded : 245
Categories : DWG
Software type : AutoCAD 2012
Rename File To : xoff.lsp
Unload or reload all xrefs.

CAD Designer Sam Lucido wrote a short and simple macro to instantly unload or reload all xrefs in an AutoCAD file.

"I often find myself working in a drawing with one or two very large external references attached. Sometimes I just want to unload (not detach) those files to focus on the area I am working in. These macros will do just that — run them and AutoCAD will load or unload all references within the file. This clears up the area and saves on regen time as well!

"For those of us who like tool palettes, place the following macro(s) in the command string on a palette.

  • This macro will unload all references: ^C^C-XREF;U;*
  • This macro will load all references: ^C^C-XREF;R;*

Notes from Cadalyst Tip Patrol: This is a simple piece of code, but it's one that can save you a lot of effort. If you turn xrefs on and off frequently — or would, if it were easier — then use this tip.


Average Rating:

User comments
Comment by DeShawn,Bill
Posted on 2012-07-31 23:39:36
This LISP code also works to do the same thing. Then you can just use XUA to do the job. No menu changes required. (defun c:xra () (command "_.-xref" "_r" "*") (princ)) Bill DeShawn http://my.sterling.net/~bdeshawn
Comment by DeShawn,Bill
Posted on 2012-07-31 23:44:13
Sorry XRA for the last one XUA for this one to unload: - (defun c:xua () (command "_.-xref" "_u" "*") (princ))