Going External

In AutoCAD, an xref, or external reference, is a reference to another, external drawing file — one outside the current drawing — that you can make act as though it's part of your drawing. Technically, a reference is simply a pointer from one file to another. The xref is the actual pointer, but many people call the combination of the pointer and the external file the xref.

In both AutoCAD and AutoCAD LT, external drawing files are just one of five different file types you can attach to your current drawing by using the Select Reference File dialog box. You use this dialog box to attach externally referenced AutoCAD drawings (xrefs), raster image files, DWF and DWFX files, PDF files, and MicroStation DGN drawing files.

image Use the Attach button on the Insert tab's Reference panel to open the Select Reference File dialog box. When you attach an external drawing to your current drawing, you become the host of the external file. No need to break out the cocktails and canapés, though … it's actually your current drawing that's doing the hosting, and in AutoCAD, it's called (what else?) the host drawing. You can think of the attached xrefs as guests, but most of the time they're pretty well-behaved ones, and like the best of guests, they go away as soon as you want them to.

Xrefs have a big advantage over blocks: If a drawing is inserted as a block into another drawing, its geometry doesn't change if the original drawing is changed in any way — it always looks the way it looks when it's inserted. If that drawing is attached as an xref, however, AutoCAD will automatically update every host drawing to which it's attached when the host drawing is reopened. You can also manually reload the changed xref if you don't want to close and reopen the host drawing.

When you open a drawing that contains xrefs, AutoCAD displays a little symbol (which looks like papers with a binder clip) on the right end of the status bar. This symbol alerts you to the fact that some of the things you see in the drawing are actually parts of other, xrefed drawings. If an xref changes while you have the host drawing open (because you or someone else opens and saves the referenced drawing), the status bar xref symbol displays an External Reference Files Have Changed balloon notification. Simply click the Reload link in the balloon notification to show the updated xrefs. (If you want to change how AutoCAD checks for changes, look up XREFNOTIFY in the online help.)

Another advantage that xrefs have over blocks is that their contents aren't stored in your drawing even once. The disk storage space taken up by the original drawing (that is, the xref) isn't duplicated, no matter how many host drawings reference it. This characteristic makes xrefs much more efficient than blocks for larger drawings that are reused several times.

You can always buy a larger hard drive, however, so the storage issue isn't crucial. The key benefit of xrefs is that they enable you to organize your drawings so the changes you make to a single drawing file automatically “ripple through” all the host drawings into which it's xrefed. This benefit is even greater on larger projects involving multiple drafters, each of whose work may be incorporated in part or in whole in the work of others.

image The automatic update feature of xrefs is a big advantage only if you're organized about how you use xrefs. Suppose that an architect creates a plan drawing showing a building's walls and other major features that are common to the architectural, structural, plumbing, and electrical plan drawings. The architect then tells the structural, plumbing, and electrical drafters to xref this background plan into their drawings so that everyone is working from a consistent and reusable set of common plan elements. If the architect decides to revise the wall locations and updates the xrefed drawing, everyone will see the current wall configuration and be able to change their drawings. But if the architect absentmindedly adds architecture-specific objects (toilets and furniture, for example) to the xrefed drawing, or shifts all the objects with respect to 0,0, everyone else will have problems. If different people in your office share xrefs, create a protocol for who is allowed to modify which file when, and what communication needs to take place after a shared xref is modified.

Becoming attached to your xrefs

Attaching an external reference drawing is similar to inserting a block, and almost as easy. Just use the following steps:

  1. Set an appropriate layer current, as described in Chapter 6.

    It's a good idea to insert xrefs on a separate layer from all other objects. Note that if you freeze the layer an xref is inserted on, the entire xref disappears. (This behavior can be either a handy trick or a nasty surprise.)

  2. If the External References palette isn't already open, click its icon (it looks like a sheaf of papers with a bulldog clip and a silhouetted user) on the Palettes panel of the View tab to open it.

    The toolbar at the top of the palette lets you attach an external DWG file, a DWF underlay, a PDF underlay, a MicroStation DGN drawing file, or a raster image file. I cover attaching images and DWFs or PDFs later in this chapter. If you need to attach DGN files, visit the online help.

  3. Click Attach DWG. (Click the down arrow if the tooltip offers to attach something else — see Figure 18-8.)

    The Select Reference File dialog box appears.

  4. Browse to find the file you want to attach, select it, and then click Open.

    The Attach External Reference dialog box appears.

  5. Specify the parameters for the xref in the dialog box.

    Parameters include the insertion point, scaling factors, location based on geographic data, and rotation angle (I describe geographic location briefly in Chapter 17). You can set these parameters in the dialog box or specify them on-screen, just as you can do when inserting a block, as described in Chapter 17.

    image You can select the Attachment or Overlay radio button to tell AutoCAD how to handle the xref. The choice matters only if you create a drawing that uses xrefs, and then your drawing is, in turn, used as an xref. Attachment is the default choice, and it means that the xrefed file will always be included with your drawing when someone else uses your drawing as an xref. Overlay, the other choice, means that you see the xrefed drawing, but someone who xrefs your drawing won't see the overlaid file. By choosing Overlay, you can xref a map, for example, to your drawing of a house but not have the map show up when someone else xrefs your house drawing. (That person can xref the map, if need be.) I recommend that you use the default Attachment reference type unless you have a specific reason to do otherwise.

    image

    Figure 18-8: Using the External References palette to attach an xref.

    The Path Type drop-down list provides more flexibility in how the xref path gets stored. See the “Forging an xref path” section, later in this chapter, for more information. For now, I recommend that you choose Relative Path instead of the default Full Path.

  6. Click OK.

    The externally referenced file appears in your drawing.

In drawings that contain a lot of xrefs, it can be difficult to locate the one you want. AutoCAD 2011 added an enhancement to the External References palette: When you select an object that's part of an xref in the drawing area, the xref's name highlights in the External References palette. Likewise, selecting an xref in the External References palette highlights the attached file geometry in the drawing editor.

Layer-palooza

When you attach or overlay an xref, AutoCAD adds new layers to your current drawing that correspond to the layers in the xrefed DWG file. The new layers are assigned names that combine the drawing name and layer name; for example, if you xref the drawing MYSCREW.DWG, which has the layer names GEOMETRY, TEXT, and so on, the xrefed layers will be named MYSCREW|GEOMETRY, MYSCREW|TEXT, and so on. By creating separate layers corresponding to each layer in the xrefed file, AutoCAD eliminates the potential problem with blocks I warn you about in Chapter 17, when layers have the same name but different color or linetype in the two drawings.

Creating and editing an external reference file

To create a file that you can use as an external reference, just create a drawing and save it. That's it. You can then create or open another drawing and create an external reference to the previous one. The xrefed drawing appears in the host drawing as a single object, such as a block insert. In other words, if you click any object in the xref, AutoCAD selects the entire xref. You can measure or object snap to the xrefed geometry, but you can't modify or delete individual objects in the xref — you open the xref drawing in order to edit its geometry.

image The XOPEN command provides a quick way to open an xrefed drawing for editing. You just start the command and pick any object in the xref. Alternatively, you can select the xref in the External References palette and then right-click and choose Open to open one or more xrefs for editing. See the “Managing xrefs” section, later in this chapter, for more information.

image An alternative to opening the xrefed file when you need to edit it is to use the REFEDIT command. REFEDIT (short for Reference Edit) lets you edit the external file from within the host drawing, rather than having to open the reference in its own window. Look up REFEDIT in the AutoCAD online help system's Command Reference.

With several xrefs attached to your drawing, it can be difficult to tell which objects belong to the drawing you're currently editing, and which are part of the xref. For several releases it's been possible to fade a reference file while using REFEDIT. In AutoCAD 2012, you can fade your xrefs at all times, not just when you're editing them, as follows:

  1. Open a drawing containing an external reference drawing.

    Alternatively, you can attach a drawing to your current drawing by following the steps in the “Becoming attached to your xrefs” section, earlier in this chapter.

  2. On the Insert tab, click the Reference panel label to open the Reference slideout.

    The Reference slideout also contains the Edit Reference button which runs the REFEDIT command described in the previous section.

  3. image Click the Xref Fading button to toggle reference fading off and on.
  4. Drag the Xref Fading slider to increase or decrease the level of fading in the reference file.

    The default value is 70; increasing the value toward 90 (the maximum) increases the degree of fading, while lowering it reduces the fade level.

Forging an xref path

When you attach an xref, AutoCAD, by default, stores the xref's full path — that is, the drive letter and sequence of folders and subfolders in which the DWG file resides — along with the filename. This default behavior corresponds to the Full Path setting in the Path Type drop-down list. (Figure 18-9 shows the three xref path options.) Full Path works fine as long as you never move files on your hard drive or network and never send your DWG files to anyone else — which is to say, it almost never works fine!

image

Figure 18-9: Follow the path less traveled when you attach an xref.

At the other end of the path spectrum, the No Path option causes AutoCAD not to store any path with the xref attachment — only the filename is stored. This is the easiest and best option if the host drawings and the xrefs reside in the same folder. However, if the host and the xref are in different folders, you have to browse to find the reference file every time you open the host drawing.

If you prefer to organize the DWG files for a particular project in more than one folder, you'll appreciate AutoCAD's Relative Path option, as shown in Figure 18-9. This option permits xrefing across more complex folder structures but avoids many of the problems that the Full Path option can cause. For example, you may have a host drawing, H:Project-XPlansFirst floor.dwg, that xrefs H:Project-XCommonColumn grid.dwg. If you choose Relative Path, AutoCAD will store the xref path as .. CommonColumn grid.dwg instead of H:Project-XCommonColumn grid.dwg. This way, if you decide to move the Project-X folder and its subfolders to a different drive (or send them to someone else who doesn't have an H: drive), AutoCAD can still find the xrefs.

image When you use Relative Path, you'll see xref paths that include the special codes . and .. (single and double period). The single period means this host drawing's folder, and the double period means the folder above this host drawing's folder.

You can report on and change xref paths for a set of drawings with the Reference Manager (not in AutoCAD LT). See Chapter 20 for more information.

image If all these path options and periods leave you feeling punchy, you can keep your life simple by always keeping host and xref drawings in the same folder and using the No Path option when you attach xrefs.

Managing xrefs

The External References palette includes many more options for managing xrefs after you attach them. Many of these options are hiding in right-click menus. Important options include

  • List of external references: You can change between the List view and Tree view of your drawing's external references just by clicking the appropriate button at the top of the palette (refer to Figure 18-8). You can resize the columns by dragging the column dividers or re-sort the list by clicking the column header names, just as in Windows Explorer.
  • Unload: Right-click an xref and choose Unload to make the selected xref disappear from the on-screen display of your drawing and from any plots you do of it, but retain the pointer and attachment information. Right-click again and choose Reload to redisplay an unloaded xref.
  • Reload: Right-click an xref and choose Reload to force AutoCAD to reread the selected xrefed DWG file from the disk and update your drawing with its latest contents. This feature is handy when you share xrefs on a network and someone has just made changes to a drawing that you've xrefed.
  • Detach: Right-click an xref in the External References palette and choose Detach to completely remove the selected reference to the external file from your drawing.
  • Bind: Right-click an xref and choose Bind to bring the selected xref into your drawing and turn it into a block. You might, for example, use this function to roll up a complex set of xrefs into a single archive drawing.

    image In many offices, binding xrefs without an acceptable reason for doing so is a crime as heinous as exploding blocks indiscriminately. In both cases, you're eliminating an important data-management link. Find out what the policies are in your company. When in doubt, keep yourself out of a bind. And even when you do have a good reason to bind, you generally should do it on a copy of the host drawing.

  • Open: Right-click an xref and choose Open to open one or more xref drawings in separate drawing windows. After you edit and save an xref drawing, return to the host drawing and use the Reload option in the External References palette to show the changes.

None of these options (other than opening and editing the xref) affects the xrefed drawing itself; it continues to exist as a separate DWG file. If you need to delete or move the DWG file that the xref refers to, do it in Windows Explorer.

image The fact that the xrefed drawing is a separate file is a potential source of problems when you send your drawing to someone else; that someone else needs all the files that your drawing depends on, or it will be useless. Make sure to include xrefed files in the package with your drawing. See Chapter 20 for a procedure.

Both AutoCAD 2012 and AutoCAD LT 2012 include an additional xref feature called xref clipping: You can clip any kind of externally referenced file or block insertion so only part of it appears in the host drawing. Use the CLIP command to trim away unwanted parts of xref drawings, DWF and DWFx files, raster images, MicroStation DGN files or PDFs. You can even clip block insertions. For more information, look up CLIP in the online help's Command Reference section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset