How do I detach, unload, or repath XREFs across many drawings?


Two common pain points with external references at scale: unloaded xrefs that block binding (you're binding a thousand sheets and the ones with unloaded xrefs fail), and repathing archived projects whose xref paths have moved. Both are scriptable through Hurricane with the command-line -XREF command.

The -XREF command and its options

-XREF is the no-dialog version of the external-references tool. It exposes these options:

Command: -XREF
Enter an option [?/Bind/Detach/Path/Unload/Reload/Overlay/Attach]

Detach an xref (so the drawing will bind)

-XREF
DETACH
{xref name}

Replace {xref name} with the block name of the external reference.

Repath an xref

-XREF
PATH
{xref name}
{new path}

Replace {new path} with the new location, for example a relative path like .\xref\grid.dwg.

You need the xref's name. -XREF acts on a named reference. If every drawing uses the same xref names, a fixed script works directly. If the names vary, loop over them in a short LISP routine (the xref block names are available from the drawing's block table) and call -XREF for each, then let Hurricane run that across the whole set. See How do I run a Lisp routine on all my files?
💬 From the Hurricane Forum: Script to detach unloaded xrefs before binding · Repath xrefs across an archived project · Finding xrefs

Related

Check first with Tornado: Tornado DWG Scanner's Missing xrefs check lists xrefs whose saved path does not resolve, and its Xref path types check flags absolute paths, for every drawing in a folder, in one spreadsheet.

PreviousBack to Hurricane for Autodesk® AutoCAD® - FAQNext