You send a drawing to someone, they open it, and the title block is empty. Nothing is corrupted and nothing is lost. That drawing is borrowing its content from another file through an xref in AutoCAD, and the other file did not travel with it.
This article measures how that borrowing works on AutoCAD 2027 at the Institute: what layer names appear, how they change when the reference is bound, and what the program says when the source disappears. For the whole discipline of organising a large drawing set, see the advanced AutoCAD course.
What an xref in AutoCAD really is
The full name is external reference. The alias is XR, and Autodesk describes the full command on the XREF page in exactly one line: "Starts the EXTERNALREFERENCES command."
We wrote a small plan out to its own file, attached it to a host drawing, and then read back the object that appeared.
| Measurement | Result |
|---|---|
| Object type | INSERT |
| Block name | the source file name |
| External reference flag on the block record | present |
| Path recorded | .\xr-nguon.dwg |
The first row surprises most people. Inside the file, an xref in AutoCAD sits exactly where a block sits, with the same INSERT object type. The only difference is a flag on the block table record saying the content lives elsewhere. How ordinary blocks behave is covered in our article on blocks in AutoCAD.
The last row is worth noting: the path recorded is relative, beginning with a dot. Why, in a moment.
Attaching a file and the three kinds of path
Typing XR opens the palette, and Attach does the job. The command line version, -XREF, shows everything the command can do at once. Copied verbatim from the 2027 release.
Enter an option [?/Bind/Detach/Path/pathType/Unload/Reload/Overlay/Attach/Show] <Attach>:
Nine options, four of which are daily work.
| Option | What it does |
|---|---|
Attach | brings a file in as a reference |
Reload | pulls in the latest content of the source |
Unload | stops displaying it, keeps the link |
Detach | cuts the link entirely |
Which kind of path is stored is decided by REFPATHTYPE, and our machine measured 1.
REFPATHTYPE | Meaning |
|---|---|
| 0 | no path saved |
| 1 | relative path saved |
| 2 | full path saved |
One is both the default and the right answer for a set you intend to send out. A relative path means the program remembers where the source sits in relation to the host drawing, so copying the whole folder to another machine keeps the link alive. A full path records the drive letter, and that breaks the moment it leaves your machine.
Bind an xref: two kinds, and the layer names differ
This is where every tutorial we read says Bind and Insert are "basically the same". Measured, they are not the same at all, and the difference is in the xref layer names.
We attached a file with a layer called XR-TUONG, then listed the layer table at each step.
Step Layer name in the host drawing
-------------------------- ------------------------------
Before attaching (none)
After attaching xr-nguon|XR-TUONG
Bound with BINDTYPE = 0 xr-nguon$0$XR-TUONG
Bound with BINDTYPE = 1 XR-COT
Those last three lines are the three states people confuse. While it is still a reference, the layer name carries the file name and a vertical bar as a prefix. Bound the standard way, the bar becomes $0$ and the layer stays a layer of its own.
Autodesk describes exactly that in the bind dialog. Bind is "Binds the selected DWG reference to the current drawing. Xref-dependent named objects are changed from blockname|definitionname to blockname$n$definitionname syntax."
The last line is the worrying one. Set BINDTYPE to 1 and the source file's layers merge into any local layer of the same name, prefix and all. Autodesk calls this Insert and describes it as "Binds the DWG reference to the current drawing in a way similar to detaching and inserting the reference drawing."
In our measurement the host drawing already had a layer called XR-COT. After an Insert-style bind, every line from the source sat on that existing layer and took its colour and linetype. No warning of any kind.
Which to choose depends on the job. To keep the referenced drawing exactly as it was, use Bind. For a tidier file with fewer layers, use Insert — but know beforehand that layers sharing a name get merged.
Detach an xref, because deleting it does not
A very common question, with a trap we could measure.
We selected the reference and deleted it with ERASE, then looked at the block table again.
| Action | Block record of the source |
|---|---|
Deleted with ERASE | still there |
Removed with Detach | gone |
So wiping the linework off the screen does not cut the link. The drawing still remembers the source file, still asks for it every time it opens, and the recipient still sees a missing-file message even though not one line of it is drawn.
To cut the link properly, use Detach. To keep the content inside your own file instead, bind it rather than remove it. What is left behind in a file after operations like these is covered in our article on slimming down a CAD drawing.
VISRETAIN, or why your layer changes keep coming back
A familiar situation. You turn off a few layers of the referenced drawing to see what you are doing, and the next morning they are all on again.
The culprit is VISRETAIN, which Autodesk describes as "Controls the properties of xref-dependent layers." We measured it by changing the colour of a referenced layer and then reloading.
VISRETAIN | Original colour | After the change | After reloading |
|---|---|---|---|
| 0 | 3 | 1 | 3 |
| 1 | 3 | 1 | 1 |
The two rows differ in exactly one cell, and that is the whole story. At 0 your layer edits are thrown away on every reload; at 1 they are kept.
Autodesk is explicit about the value 1: "Xref-dependent layer changes made in the current drawing take precedence. Layer settings are saved with the current drawing's layer table and persist from session to session."
Our machine measured the default as 1, so it is already right. If you meet the disappearing-settings problem, check this variable first, because it is saved per drawing rather than per machine. Working with layers generally is covered in our article on layers in AutoCAD.
What the program says about a missing source file
A drawing that opens with an empty sheet is the single most reported problem with references, so it is worth seeing the exact wording rather than guessing at it.
We renamed the source on disk and ran a reload. The program answered with exactly two lines, copied verbatim.
Reload Xref "xr-bon": .\xr-bon.dwg
"xr-bon.dwg" cannot be found.
The screen then looks like the right half of the figure above: the title block still there, the referenced content gone completely. Nothing of it stays behind.
Three causes, in order of how often we see them.
The file was not sent. Only the host drawing was copied and mailed, and the source stayed on the author's machine. This is cause number one by a wide margin.
Renaming or moving a folder. A relative path survives copying a whole folder tree elsewhere; it does not survive renaming a folder somewhere along that path.
A full path. The drawing records a drive letter belonging to the author's machine. The recipient has no such drive.
There are only two real cures before a set goes out: bind everything, or package it with ETRANSMIT so the program gathers the dependent files itself. Neither is optional once an xref in AutoCAD leaves the machine it was made on.
How a team of several people uses references
The real benefit is not a smaller file. It is having one single source.
The architectural plan is one file. The structural, electrical and plumbing drawings are separate files, and all three reference that same plan. Architecture moves a wall, the other three reload, and everyone sees it. Nobody copies the plan again.
Three habits keep this from falling apart.
Keep the source beside the host drawing, under one common root folder, and leave REFPATHTYPE at 1.
Prefix layer names with the discipline inside the source file itself. An Insert-style bind merges layers sharing a name, and a prefix is the only thing that prevents it.
Use Overlay instead of Attach where references nest. An attachment drags its own child references along; an overlay does not, which avoids two disciplines referencing each other into a loop.
When the referenced content has to reach a printed sheet, the viewport mechanism is covered in our article on rotating a drawing in a layout.
Three things often repeated that are not true
| Often repeated | What we measured on the 2027 release |
|---|---|
| Bind and Insert are basically the same | The layer names differ: $0$ keeps a separate layer, Insert merges into an existing one |
| Deleting the linework removes the reference | The block record survives; only Detach cuts the link |
| Layer changes on a reference cannot be saved | With VISRETAIN at 1 they survived a reload, measured |
Frequently asked questions
What is the alias?
XR, which opens the External References palette. For the command line version, type -XREF.
How do Bind and Insert differ?
In the layer names. Bind gives filename$0$layername and keeps a separate layer. Insert drops the prefix, so a layer sharing a name is merged into the existing one and takes its colour.
Does pressing Delete remove a reference?
No. We deleted with ERASE and then checked the block table, and the record of the source was still there. Use Detach.
How do I send a drawing so nothing is missing?
Either bind everything before sending, or use ETRANSMIT so the program packages the source files with it.
Why do the layers I turned off come back on?
Check VISRETAIN. At 0 every edit is discarded on reload; at 1 it is kept. The variable is saved per drawing.