Going External

9:18 AM Posted In , , , , , , , , , , , , , , Edit This 0 Comments »

In AutoCAD, an xref, or external reference, is not someone who used to be an official in a sporting contest. An xref is a reference to another, external 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 the combination of the pointer and the external file often is called the xref.

Drawings that you include as xrefs in other drawings often are called child drawings. Drawings that contain pointers to the child drawings are called parent drawings. This family terminology gets a little weird when you realize that a child drawing can have lots of parent drawings that refer to it — apparently it’s the commune version of family relations. If you find such relationships odd, you can, like the AutoCAD online help system, refer to the parent drawing as the host drawing. I prefer the terms parent and child, in part because they’re easily extendable to describing more complex hierarchies, such as a parent drawing, which xrefs a child drawing, which in turn xrefs a grandchild drawing.

Xrefs have a big advantage over blocks: If you change a child drawing, AutoCAD automatically loads the change into all the parent drawings that reference the child drawing.

Technical Stuff AutoCAD loads all xrefs into the parent drawing each time the parent drawing is opened. If the child drawing has been changed, AutoCAD automatically incorporates those changes into the parent drawing.

New for 2004 When you open a drawing containing xrefs, AutoCAD 2004 displays a little symbol (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 parent drawing open (because you or someone else opens and saves the child drawing), the status bar xref symbol displays an External Reference Files Have Changed balloon notification. You can use the Reload option in the Xref Manager dialog box to show the updated xrefs. See the "Managing xrefs" section later in this chapter for details.

Another advantage of xrefs 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 parent drawings reference it. This characteristic makes xrefs much more efficient than blocks for larger drawings that are reused several times.

But you can always buy more hard disk space, so the storage issue isn’t crucial. The key benefit of xrefs is that they enable you to organize your drawings in a modular way so that changes you make to a single drawing file automatically “ripple through” all the parent drawings to 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.

Warning 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 absent-mindedly adds architecture-specific objects, such as toilets and furniture, 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 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 4.

    I recommend that you 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.

  2. Choose InsertðXref Manager from the menu bar to start the XREF command.

    Warning Don’t choose InsertðExternal Reference. This menu choice jumps ahead to Step 4, which will be confusing at this point.

  3. Click Attach.

    The Select Reference File dialog box appears.

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

    The External Reference dialog box appears.

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

    Parameters include the insertion point, scaling factors, and rotation angle. 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 earlier in this chapter.

    Technical Stuff You can choose 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 it 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 in 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.

    New for 2004 The AutoCAD 2004 Path Type drop-down list provides more flexibility in how the xref’s 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.

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 I warned you about with blocks when layers have the same name but different color or linetype in the two drawings.

Technical Stuff AutoCAD also creates new linetypes, text styles, dimension styles, and block definitions for each of these items in the xrefed file — for example, MYSCREW| DASHED, MYSCREW|NOTES, MYSCREW|A-DIMS, and MYSCREW|LOGO.

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 (or use the WBLOCK command to create a new DWG from geometry in the current drawing). That’s it. You can then start up a new drawing and create an external reference to the previous one. The xrefed drawing appears in your parent drawing as a single object, like 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.

New for 2004 AutoCAD 2004’s new XOPEN command (ModifyðXref and Block EditingðOpen Reference) provides a quick way to open an xrefed drawing for editing. You just start the command and pick on any object in the xref. Alternatively, you can use the Open button in the Xref Manager dialog box to open one or more xrefs for editing. See the “Managing xrefs” section later in this chapter for more information.

Tip An alternative to opening the xrefed file when you need to edit it is to use the REFEDIT command (ModifyðIn-Place Xref and Block EditðEdit Reference). Look up “REFEDIT” in the AutoCAD online help system.

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, as shown in Figure 13-8. Full path works fine as long as you never move files on your hard disk or network and never send your DWG files to anyone else — which is to say, it almost never works fine!

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 parent and child drawings reside in the same folder.

New for 2004 If you prefer to organize the DWG files for a particular project in more then one folder, then you’ll appreciate AutoCAD 2004’s new Relative path option. This option permits xrefing across more complex, hierarchical folder structures, but avoids many of the problems that Full path can cause. For example, you might have a parent drawing H:\Project-X\Plans\First floor.dwg that xrefs H:\Project-X\Common\Column grid.dwg. If you choose Relative path, AutoCAD will store the xref path as ..\ Common\Column grid.dwg instead of H:\Project-X\Common\Column grid.dwg. Now 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 will still be able to find the xrefs.

Technical Stuff 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 parent drawing’s folder" and the double period means "the folder above this parent drawing’s folder" (in other words, the folder of which the parent drawing’s folder is a subfolder).

You can report on and change xref paths for a set of drawings with the new AutoCAD 2004 Reference Manager. See Chapter 15 for more information.

Tip If all of these path options and periods have got you feeling punchy, you can keep your life simple by always keeping parent and child drawings in the same folder and using the No path option when you attach xrefs.

Managing xrefs

The Xref Manager dialog box includes many more options for managing xrefs after you attach them. Important dialog box options include:

  • List of external references: You can change between a List and a Tree view of your drawing’s external references just by clicking the appropriate button at the top of the dialog box. You also can resize the columns by dragging the column dividers or re-sort the list by clicking the column header names, just as in other Windows dialog boxes.

  • Detach: Completely removes the selected reference to the external file from your drawing.

  • Reload: Causes 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.

  • Unload: Makes the selected xref disappear from the on-screen display of your drawing and from any plots you do of it, but retains the pointer and attachment information. Use the Reload button to redisplay an unloaded xref.

  • Bind: Brings the selected xref into your drawing and makes it a block. This is a good thing to do if, for example, you need to protect your drawing from changes that may be made to the xrefed file.

  • New for 2004 Open: Opens one or more xref drawings in separate drawing windows after you close the Xref Manager dialog box. After you edit and save an xref drawing, return to the parent drawing and use the Reload option in the Xref Manager dialog box to show the changes.

None of these options 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.

Remember 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 to the receiving party. Make sure to include xrefed files in the package with your draw procedure.

AutoCAD LT AutoCAD (but not AutoCAD LT) includes an additional xref feature called xref clipping. You can use the XCLIP command to clip an externally referenced file so only part of it appears in the parent drawing. AutoCAD LT doesn’t include the XCLIP command, but if you open a drawing containing an xref that was clipped in AutoCAD, the clipped view will be preserved.

0 comments: