You are on page 1of 17

DFTG 2419 Intermediate CAD

Student Guide

WORKING WITH EXTERNAL


REFERENCES (XREFS)
Definition
An external reference is a pointer that resides in a drawing (see Figure 1). The pointer
references another drawing that is external to the parent drawing. A referenced drawing is
visible within the parent drawing.

Figure 1. An XREF is a pointer

Concepts
External references (XREFs) are useful in an environment where a team of drafters is
working on a project, with each person constructing individual components of the
project. Each team member can view drawings belonging to others, so that changes
are handled and drawings stay synchronized.
To create an XREF, you attach a referenced drawing to a parent drawing. An attached
XREF appears as a single entity on the current layer in the parent drawing, similar to
an inserted block.
Referencing a drawing is different from inserting a drawing. Inserting a drawing takes
a snapshot of a drawing in its current state. The snapshot is not updated if the inserted
drawing changes.
On the other hand, when you open a drawing that contains an XREF, you see the
most recently saved version of the referenced drawing.
A drawing can contain multiple XREFs (see Figure 2).
A drawing can reference another drawing, which may reference yet other drawings,
which may result in nested XREFs. A nested XREF is one that is attached to a parent
drawing through another drawing (see Figure 2).
A drawing can be both a parent and an XREF (see Figure 2).
Two drawings can reference each other, resulting in a circular reference (see Figure 3).
To follow along with the discussion in this lecture, copy the folder named Xref Files
from the Unit 2 folder in the Shared directory to your own User directory.

97

DFTG 2419 Intermediate CAD

Student Guide

A drawing can be
both a parent and
an XREF.

A nested XREF is
one that is not
directly attached to
a drawing.
Nesting depends
on a setting called
Reference type.

Drawings C and D
may be nested in
drawing A.

Drawing D may be
nested in drawing B.

Figure 2. Multiple XREFs

Circular
reference

XREF
configurations
can become
complex.

Depending on how these


XREFs are defined, ALL
of these drawings may be
visible in drawing A.

Figure 3. A complex XREF configuration

98

DFTG 2419 Intermediate CAD

Student Guide

There is a set of operations you can perform on an XREF:


You can open an XREF drawing to edit it from within the parent drawing.
You can unload an XREF to remove it from your display while it stays attached to the
parent.
You can reload an XREF to force AutoCAD to re-read the XREF drawing file.
You can detach an XREF drawing from the parent.
You can bind certain objects or an entire XREF drawing into a parent.
Objects you can bind are called named dependent objects.
You can change settings of referenced layers from within the parent drawing. Layer
settings affect only the parent drawing and do not affect layer settings in the
referenced drawing.
You can save time and system resources by clipping unneeded portions of XREF
drawings.
Tools for working with XREFs are on the Reference ribbon panel on the Blocks &
References ribbon tab (see Figure 5) and the Reference toolbar (see Figure 4).

Xattach

Xref

Xbind

Xclip

Xclipframe

Figure 4. Reference Toolbar

Figure 5. Reference ribbon panel

Inserting an XREF
The XATTACH command provides one way to specify a drawing file to be referenced
into the current drawing as an XREF.
Command line:

XATTACH

Ribbon:

Blocks & References Reference

Reference toolbar:
Pulldown:

(see Figure 4)
Insert DWG Reference

99

(see Figure 5)

DFTG 2419 Intermediate CAD

Student Guide

When you invoke XATTACH,


the Select Reference File dialog
box appears (see Figure 6),
where you can navigate to and
select the drawing you want to
reference.

Figure 6. Reference Toolbar

When you have selected a file, the


External Reference dialog box
appears (see Figure 7), where you
can specify the reference type,
insertion point, scale factors, and
rotation angle. Check the
appropriate boxes if you wish to
specify any of these items on
screen instead of here in the
dialog box.

Figure 7. External Reference dialog box

100

DFTG 2419 Intermediate CAD

Student Guide

The Squares drawing appears in the Circles drawing (see Figure 8).
Circles is the
parent;
Squares is the
XREF.

Squares.dwg
is attached to
Circles.dwg.

Figure 8. External Reference dialog box

Selecting any
square
selects the
entire XREF.

Reference Type
The reference type determines whether XREFs are nested.
The reference type can be attachment or overlay.
A referenced drawing that is an attachment is visible in the parent of its parent
drawing. It is called a nested XREF (see Figure 9).
A referenced drawing that is an overlay is not visible in the parent of its parent
drawing (see Figure 9).

Figure 9. Attachment vs. Overlay

101

DFTG 2419 Intermediate CAD

Student Guide

The default reference type is attachment.


Overlays are recommended to prevent unduly complicated XREF configurations.
If all Reference types are attachments, then all XREF drawings are visible in all
drawings all the way up the chain.
Drafters further up the chain may be unnecessarily loading and viewing XREFs that
they dont need.
Using overlays breaks the chaining created by attachment XREFs.
Using overlays means all drafters must choose which drawings to XREF into their
drawing.

Dependent Objects
A dependent object is a named non-graphical entity that is defined within a referenced
drawing.
Dependent objects are block definitions, dimension styles, layers, linetypes, and text
styles.
An XREFs dependent objects are visible within the parent drawing.
To avoid name conflicts, dependent objects assume a different name in a parent
drawing.
When an XREF is attached, its dependent objects are denoted by the XREF drawing
name followed by a vertical bar (|) and then by the object name. For example, in a
parent drawings layer table, you might see a layer named Foundation Details|Beams.
You cannot access, rename, or delete dependent objects from the parent drawing.
You can, however, bind an entire referenced drawing, including its named dependent
objects, or you can bind individual dependent objects.
XREF Layers
When you attach an XREF to a parent drawing, the parent drawing receives a copy of
the layer table from the XREF drawing.
The special naming for dependent objects separates XREF layers from layers in the
parent drawing (see Figure 10).
Attaching an external reference can introduce unreconciled layers (see Reconciling
Layers below).

Parent layers

XREF layers

Figure 10. XREF layers are kept separate from parent layers

102

DFTG 2419 Intermediate CAD

Student Guide

Changes you make affecting XREF-dependent layer settings can be saved or


discarded when you save the parent drawing.
The XREF layer settings you can change are On/Off, Freeze/Thaw, Color, and
Linetype.
If you wish, these changes to layer settings can be saved in the parent drawing.
The referenced drawing is unaffected by changes to layer settings made in the parent
drawing.
Consider the following example:
Example

Suppose an XREF drawing contains 200 layers.

Suppose you freeze 100 of them in the parent drawing, then


save and close the parent drawing.

When you re-open the parent drawing, should those 100 layers
still be frozen?

The answer depends on the setting of a system variable named VISRETAIN.


You can modify this setting in two ways:
o On the Open and Save tab of the Options dialog, check the box labeled Retain
changes to Xref layers to save changes, or uncheck this item to discard changes.
o Type VISRETAIN at the Command prompt and enter a new value.
0
Changes made are discarded when the parent drawing is closed.
1
(default) Changes made are retained when the parent drawing is saved and
persist from session to session.

Reconciling Layers
AutoCAD 2008 introduced the concept of reconciling layers. An unreconciled layer is a
layer that has been added to the drawing but that you have not manually marked as
reconciled. Reconciling layers forces you to review the layer list so that you can avoid
potential errors before you plot your drawing or when you restore a layer state.
A baseline layer list is created the first time a drawing is saved or plotted. All layers
on the baseline layer list are considered reconciled (not new).
If you create a new layer after the baseline layer list is created, it is unreconciled until
you manually mark it as reconciled.
During an operation such as plotting, publishing, or attaching an external reference,
the current layer list is checked against the baseline layer list. If the two lists do not
match, a warning box appears (see Figure 11).

103

DFTG 2419 Intermediate CAD

Student Guide

Figure 11. Unreconciled layers notification warning

Click on Yes in the Layer Notification


Warning dialog box to display the
Layer Properties Manager dialog box,
where you can view the list of
unreconciled layers (see Figure 12).

Figure 12. Unreconciled layers in the Layer Properties


Manager dialog box

To reconcile layers, select the layer


or layers you want to reconcile in
the layer list. Press Shift or Ctrl to
select multiple layers. Then rightclick on the selected layer(s), and
choose Reconcile Layer from the
shortcut menu (see Figure 13).
When you have reconciled a layer,
it is removed from the Unreconciled
New Layers filter.
If you reconcile all unreconciled
layers, the Unreconciled New Layers
filter is removed.
Figure 13. Reconciling selected layers

The External References Palette


The External References palette (see Figure 14) lists all XREF drawings and displays
their status and other information.
Command line:

XREF or EXTERNALREFERENCES

Ribbon panel:

Blocks & References Reference

Reference Toolbar:
Pulldown:

(see Figure 4)
Insert External References

104

(see Figure 5)

DFTG 2419 Intermediate CAD

Student Guide

The External
References
palette

XREFs

Status

Reference
type

Details for a
selected
XREF

Figure 14. The External References palette

As shown in Figure 15, you


can right-click on an XREF
in the list to display a list of
options.

Right-click on
an XREF to
display a menu
of options.

Figure 15. XREF options menu

Open
Attach

Opens the XREF drawing for editing in your current AutoCAD session.
Displays the External Reference dialog box.

105

DFTG 2419 Intermediate CAD

Student Guide

Maintains the link to the referenced drawing, but removes it from the
display to reduce clutter and regeneration time. Reload the drawing to
make it re-appear.
Re-reads a referenced drawing file.
Breaks the link between the parent drawing and the referenced
drawing. The detached drawing immediately disappears from the
display.
Equivalent to Insert followed by Detach. Only for XREFs that are not
nested. Bind breaks the link between the referenced drawing and the parent
drawing, and converts the referenced drawing to a block in the parent
drawing, on the layer that was current when the drawing was referenced.
You would bind an XREF only when the XREF drawing is completely
finished (and maybe not even then). Displays the Bind Xrefs dialog box (see
Figure 16), where you specify handling for dependent objects.

Unload

Reload
Detach

Bind

Separates named
dependent objects
Combines named
dependent objects
Figure 16. Bind Xrefs dialog box

Dependent objects are block definitions, dimension styles, layers,


linetypes, and text styles. When you bind an XREF, you must specify
how to resolve potential conflicts between dependent objects that have
the same name in both drawings, but different settings.

The Bind option keeps dependent objects separate. It retains the


prefix, and the vertical bar (|) is replaced by $n$, where n is a digit
from 0 9. Choose this option if there are conflicts between named
objectsfor example, if the parent and referenced drawings
contain two layers with the same name but different properties and
you wish to keep them both.

The Insert option merges dependent objects that have the same
name. It drops the prefix. Dependent objects with the same name
in both drawings assume the characteristics of the parent drawing.

The Details panel


The Details Panel in the External References palette displays information about a selected
XREF (see Figure 17).
Reference Name

The name assigned to the XREF when it was attached. This is usually the
filename without the extension.

Status

The current status of the XREF (see Table 1 below.)

106

DFTG 2419 Intermediate CAD

Student Guide

Type

Displays the reference type. To change to a different reference type, click


on the Type setting, then click on the down arrow and select the opposite
type. You cannot change the reference type of a nested XREF.

Found At

Displays the pathname where a selected XREF was last loaded from.

Saved Path

Updates the pathname where the referenced drawing is located.

Figure 17. The Details panel

List View/Tree View


By default, XREFs are shown in list view in the External References palette. You can
display XREFs hierarchically by switching to Tree View. Switch between List View and
Tree View by clicking on one of the two buttons in the upper left corner of the External
References palette. Tree View shows whether any XREFs are nested within other XREFs
in the parent drawing (see Figure 18).

List view
Nested
XREF

Figure 18. The External References palette in Tree View

107

Tree view

DFTG 2419 Intermediate CAD

Student Guide

In List View, the Status column in the External References palette displays the current
status of each XREF in the current drawing. Possible values for the status are shown in
Table 1 below.
Table 1. Xref Status Meanings
Status

Meaning

Loaded

The referenced file is currently attached to the drawing.


AutoCAD was unable to locate a previously-defined XREF when the parent
drawing was opened or the XREF was Reloaded.
The XREF is currently unloaded.
The XREF was found but cannot be read by AutoCAD.

Not Found
Unloaded
Unresolved
Unreferenced

A nested XREF is attached to an XREF that is no longer attached to the parent


(the path to its parent XREF may have been changed to reference a different file).

Orphaned
Opened
Needs reloading

The referenced file is attached to another file that is Unresolved or Unloaded.


This designation indicates the parent drawing.
An XREF has been modified and needs to be reloaded.

Notification of Changes to an XREF Drawing (R2004)


If an XREF drawing is changed while you are editing a parent drawing, the notification
window shown in Figure 19 below appears in the lower right corner of your screen to
notify you that the XREF drawing may need to be reloaded.

Figure 19. Notification of Change in Xref Drawing

Click on the XREF name in the notification window. AutoCAD reloads the XREF.
LOCATING UNRESOLVED XREFs
If AutoCAD cannot locate an XREF drawing when you open the parent drawing, the
XREF does not appear in the parent drawing.
Instead, AutoCAD does two things:
1. It displays a message in the command window (press F2 to see it):
Resolve Xref "desks1": \\edg\files\VIPHome\sgideon\desks1.dwg
"desks1.dwg" cannot be found.

2. It displays the pathname where it


looked for the unresolved XREF in
the drawing (see Figure 20).
Figure 20. Pathname of an unresolved XREF in a parent drawing

108

DFTG 2419 Intermediate CAD

Student Guide

You must locate the


XREF drawing and
update the path
information to reestablish the XREF
link. Invoke the XREF
command to display the

Status is
Not Found

External References

Click here
to locate
the XREF.

palette, and click on the


XREF in the list. Notice
that the status is Not
found (see Figure 21).

Figure 21. An unresolved XREF in the External References palette

In the Details panel, click in the box labeled Found At. Click on the button (see Figure
21) to invoke the Select new path dialog box.
When you have located and
opened the XREF, the new
pathname appears in the
External References palette.
The referenced drawing
appears in your display, and
its status is changed to
Loaded (see Figure 22).

Xref is
automatically
loaded.
Location is
updated.

Figure 22. An resolved XREF is loaded automatically

XBIND
The XBIND command converts any named dependent object in an XREF drawing to
a permanent part of the parent drawing.

Essentially, XBIND makes a copy of the named object in the parent drawing.

Refer to Figures 23 26 for the sequence of steps to bind an object.

Command line:
Reference toolbar:
Pulldown:

XBIND

(See Figure 4)
Modify Object External Reference Bind

109

DFTG 2419 Intermediate CAD

Student Guide

Click on the plus


sign next to an
XREF name to
expand the list of
named objects.

Figure 23. Xbind dialog box

Figure 24. List of named dependent objects

Click on the plus


sign next to a
named object to
see a list of items
in that category.

110

DFTG 2419 Intermediate CAD

Student Guide

Click on the object


you want to bind...

then click on
the Add button.

Figure 25. Selecting an object to be bound

Bound objects
appear here.

Click on Remove
to unbind.
Click OK when
you are finished.

Figure 26. An object after binding

When you close the dialog box, bound objects are renamed as discussed earlier: the
vertical bar (|) is replaced by the $n$ notation, where n is a number from 0-9.
You can also open DesignCenter to import named objects from another drawing.

XCLIP
The XCLIP command lets you visually crop a selected XREF or a block to display only the
portion inside a boundary that you define (see Figure 27). The portion of the XREF or block
outside the boundary does not appear. Clipping saves system resources and improves
performance.

111

DFTG 2419 Intermediate CAD

Student Guide

Figure 27. Drawing a polygonal clipping boundary

After clipping, only the part of the XREF within the boundary is visible (see Figure 28).

Figure 28. A clipped XREF

Command line:

XCLIP

Ribbon panel:

(see Figure 5)

Reference toolbar:

(see Figure 4)

Pulldown:

Modify Clip Xref

When XCLIP prompts you to select an object, select an XREF. You can specify the
following options in the XCLIP command:
New boundary
Displays additional prompts from which you determine the shape
of the clipping boundary: an existing polyline, a polygon, or a
rectangle.
On
Displays only the geometry inside the clipping boundary.

112

DFTG 2419
2
Intermediatee CAD

Off
Delette
Clipd
depth
Gene
erate Polyline
e

Student Guide

Displaays the entiree XREF (or block),


b
disreegarding the clipping
boundaary.
Deletees an existingg clipping booundary; turnn on the bouundary to
select it.
i
Lets yoou create froont and backk clipping plaanes for 3D objects.
Drawss a polyline on
o top of an existing clippping boundaary.

Whenn you clip an


n XREF, thee boundary you
y drew doees not appearr in the draw
wing. You
can force
fo it to app
pear by turning it on in one
o of these ways (see Figure
F
29):
Click
C
on the External
E
Refe
erence Clip Frrame button (
) in thee Reference toolbar.
t
Click
itt again to turrn off a clippping boundarry.
Post the Modiffy menu and
d choose Objeect Externaal Reference Frame. Select it again
too turn off a clipping
c
bounndary,
Set the value of the XCLIIPFRAME system
s
variabble to 1 to display
d
the cllipping
boundary. Sett it to 0 to tuurn off a clippping boundaary.

Figu
ure 29. A clipped XREF with the frame
f
turned on

If youu need to seee the entire XREF


X
again, simply turnn off clipping. Invoke thhe XCLIP
comm
mand, select the XREF or
o the boundary, and chooose OFF to turn clippingg off.

113

You might also like