An XREF is little more than a block whose definition resides OUTSIDE the current file, or rather externally Referenced. There are a couple of extended features that blocks don’t have, but that’s basically all they are.
Source File = File that will be xref’d into the Target file
Target File = File that will receive the XREF.
ATTACH/OVERLAY
ATTACH - an XREF that is ATTACHed follows it’s target around so that when the target file is xref’d into yet another file the attachment is attached as well
OVERLAY - an XREF that is OVERLAY’d in the target file only. When the target file is subsequently attached the overlaid file does NOT follow along.
Xrefs can be used just like blocks to build an assembly out of various other parts. In this case the xref’d components may need to follow the assembly as it is xref’d into other files. Here, ATTACH the components.
Xrefs are extremely valuable for sharing background data such as using the underground pipe as a background for the paving plans and vice-versa. In this case the background may not be required to follow its target file when subsequently xref’d. Here, OVERLAY the background.
This setting can be toggled in the xref manager dialog box by double-clicking on the word Overlay or Attach in the “Type” column to the right of the xref name.
LAYERS
Layers within xrefs can be controlled separately from the layers in the target file and even come with a built-in layer filter for the individual xrefs. These layers can be controlled in individual viewports as well.
Notice that the layers for the xref will come prefixed with the file name (or virtual name, see later) separated by a “pipe” “|”, the vertical line usually shift+backslash. This will allow control of the layers with wildcards. Example: *|* will show all the layers that contain the “pipe” (xref’d layers) or *area*|*text* will show all the layers whose xref name contains the word “area” and whose layer name contains the word “text”.
Xref’d layer can be frozen/thawed/on/off/color/linetype independent of the source file layer settings (as long as the source element’s color and linetype are bylayer). To retain these visual settings between editing sessions the VISRETAIN Setvar must be used. If VISRETAIN is set to 0, the settings are NOT retained, and will revert back to the current layer settings of the source file (If it’s thawed in the source file, it will be thawed in the target file). If VISRETAIN is set to 1, the settings in the target file are maintained without regard to the source file settings. Toggling VISRETAIN to 0 and reloading the xref (see button right side of xref manager dialog box) will force the xref’d layer to revert to the settings in the source file.
NOTE: Just like blocks, the xref resides on the layer that was active when the file was attached/overlaid. Freezing that layer will cause the entire xref to disappear, even though the layers in the xref are thawed. Freezing that layer in a viewport will cause that xref to be frozen in that viewport. For this reason we place xrefs on specific layers designed for xrefs, usually named after the xref that reside on that layer.
VIRTUAL NAME
Just like blocks xrefs can be renamed with the RENAME command.
Often the file name is the drawing number which may not be very descriptive; 6038-C-0103 doesn’t mean much. Renaming it to Area_Paving will make it more recognizable, renaming it to ZZ_ Area_Paving will also force it to sort at the end of the layer list in the manager and the pull-down. Prefixes may be used that reflect the nature of the discipline of the source file as well, to further fine tune layer control.
The same source file may be attached/overlaid several separate times, by renaming the files between attachments. This is useful for displaying the same geometry with different colors or lineweights in different viewports.
Xrefs may be re-pathed as well. Once an xref is attached/overlaid, it can be selected in the xref manager dialog box. Doing so will activate several of the buttons in the box along with one along the bottom under “Xref found at:” Selecting the “Browse” button to the right of that line will open a file selection dialog box that will allow you to select a different source file for that particular xref. It will maintain the same name, but be defined by a different file. With VISRETAIN on, layers that are the same in both source files will be reflected the same in the target file. Layers that were NOT in the previous source file will be displayed as defined in the new source file.
OTHER OPTIONS
UNLOAD – xrefs can be UNLOADed. That means the file is still attached, but the geometry is no longer displayed. The result is faster regen times. Unloading the xref will not effect its layer settings. This is useful on large files with several large xrefs, they can be unloaded individually or in groups to display the area of design concern.
RELOAD – to re-display an unloaded xref, use the reload option. Here a trick is to reset VISREATIN to 0, reload the xref, then reset VISRETAIN back to 1. That will force the layers of that xref back to match the settings in the source file. (Be aware that it will also thaw those xref layers in viewports.)
BIND – will make the xref a regular block in the current drawing and break the reference to the source file. Here there are two options.
BIND-BIND which changes the “pipe” in all xref names (layers, linetypes, styles, blocks, etc.) to $0$. Example: layer Area_Paving|PIERS will become layer Area_Paving$0$PIERS and block name Area_Paving|Bolt will become block name Area_Paving$0$Bolt. The advantage is all the layers, styles will retain their settings. The disadvantage is the overhead of additional names and elements
BIND-INSERT which inserts the file just as the INSERT command would. The xref becomes a block, and the layers/styles/blocks in the source file that have the same name as those in the target file will take on the settings of the target file.