This chapter’s discussion about freezing layers mentioned that you can insert drawing files as external -derences, in a way similar to inserting blocks. To accomplish this, you use the Insert ~ External Reference (Xref)cornm.ind. The difference between Xref files and blocks is that Xrcf files do not actually become part of the drawing’s database. Instead, they an.’ “loaded” along with the current file at startup time. It is as if AutoCAD were opening several drawings at once: the currently active file YOll specify when you start AutoCAD, and any file inserted as an Xref
If you keep Xref files independent from the current file, any changes you make to the Xref automatically appear in the current file. You don’t have to manually update the Xref file as you do blocks. For example, if you used Xref to insert the Unit file into the Plan file, and you later made changes to the Unit file, the next time you opened the Plan file, you would see the new version of the Unit file in place of the old.
Another advantage of Xref files is that since they do not actually become part of a drawing’s database, drawing size is kept to a minimum. This translates to more efficient use of your hard disk space.
Attaching a Drawing as an External Reference
The next exercise shows how to use an Xref in place of an inserted block to construct the studio apartment building. You’ll start with creating a new Unit file by copying the old one. Then you bring a new toolbar, the External Reference toolbar, to the screen.
1. Return to the Unit file; use File >- Save As to save it under the name Uni txref. dwg.You can also use the Uni txref .dwg file from the companion CD-ROM.
2. Return to the Plan file, and choose Save As and save the file under the name Planxref. The current file is now Planxref.
3. Erase all of the objects (E.J All.J) and purge the Unit, Stair, and Lobby blocks. (By doing steps 2 and 3, you save yourself from having to set up a new file.)
4. Choose File Drawing Utilities > All 1(1 purge the drawing
5. Click Insert :>Xref Manager, or type XR.J, to open the XrefMansgepdialog box
6. Click the Attach button in the Xref Manager dialog box. The Select Reference File dialog box appears. This is a typical AutoCAD File dialog box complete with a preview window,
7. Locate and select the Unitx ref. dwg file, and then click Open. The External, Reference dialog box appears.
Notice that this dia10~ })QX 10 ks similar to the Insert dialog box. It offers the same el’tiens fer insertien ,eint, scale, aml retatien.
8. You’ll get a description of the .pti ns presented in this dialog box. For now, click OK.
9. Enter 31′-5″,43′–8″ (metric users enter 957,1330) for the insertion point.
10. After the Unitxref. dwg file is inserted, recreate the same layout of the floor plan you created in the first section of this chapter by copying and mirroring the Urri tx ref. dwg external reference.
11. Save and exit the Unitxref file.
You now have a drawing that looks like the Pl an •dwg file, you created earlier in this chapter, but instead of using blocks that are detached from their source file, you have a drawing composed of Xrefs. These Xrefs are the actual Unitxref. dwg files and they are loaded into AutoCAD at the same time that you open the Pl anxref .dwg file. Next, you’ll modify the Unitxref. dwg file, then see ~ results in the Planxref . dwg file. — ,.
f . .” 1. Return to the Unitxref .dwg drawing.
2. Erase the hatch pattern and kitchen outline for the floors, and save the file.
3. Open Pl anxref. dwg again, and, notice that the Unitxref Xrefs have been updated automatically to reflect the erasure of the hatch pattern. This automatic updating does not occur with block insertions.
Importing Blocks, Layers, and Other Named Elements from external Files
You can use the Xbind.s:ommarid to import blocks and other drawing components from another files use Extention refrence Attach to cross-reference a file: type Xbin at, the command prompt. In the Xblnd qialog box, .dkk the plus sign next to the Xref file , name, and then select 8Ioc~:locate:the”name of the blOCKyou want to import, click the Add button, and click OK: Finally, use Detach’frcm the Reference dialog box to remove, the Xref file, The impoited blOCKremains as part of the current file, (See Chapter 12 for details on impOrting dra’!Ying components.) For ~eneral import of drawing components, You can alsoilSe’the·AutoCAD DesignCenter described.
Here you saw how an Xref file doesn’t have to be updated the way blocks do. Since Xrefs are loaded along with the drawing file that contains them, the containing file, which in this case was the Plan file, automatically displays any changes made to the Xref. Also, you avoid the task of having to update nested blocks, because Auto- CAD updates nested. Xrefs, as well as non-nested Xrefs.
Editing Xrefs and th. Files That Contain Them. at the Some Time
In the exercise in the section Att«hing a Drawing lIS an ExtenW Refomtce, you closed the Planxref.dwg file, edited the Unitxref .dwg file, then reopened the Pl anxraf, dwgfile. This demonstrates that the Xref is automatically updated when you open the Planxref.dwg file. You could have alse kept the P1anxref.n, file . open while editing the Unitxref.dwg file, then refreshed theUnitxref.dwg Xl’ef hem the Xref Manager dialec MX. . . To refresh an Xref, open the Xref Manager dialeg box whi1e”inthe P1anxref file. Highlight the Unitxref name in the Xref Manager dialog box list box, then click !he lteload button, then click OK. Since both the Xref file and the containing file are ‘6pened, you’ll get the message Fi 1e is oPen for edi ti ng. Unable to Demand load, Perform a full read instead?YoucanclickOKatthismesSage,then the Xref will be updated. By the way, this warning message is the same message you’d get if someone else ~ working on the Unitxref file over a network wMe you’re attempting to update the Xref in the Planxref. dwgfile.
Other Differences between External References and Blocks
.Here are a few other differences between external references (Xrefs) and inserted blocks that you will .vant to keep In mind:
• Any new, text styles, O~ .me types brought in with cross-referenced files do’ A’ .xorne part of the current file. If you want to import any of these; :1′ ” you can use the Xbind command.
• If you make changes to the layers of a cross-referenced file, those changes are not retained when the file is saved, unless you have checked the Retain Changes to Xref Layers option in the Open and Save tab of the Options dialog box. This option can be found in the External References (Xrefs) butt6n roup. This option instructs AutoCAD to remember any layer color or visibility settings from one editing session to the next. In the standard AutoCAD settings, this option is on by default.
• To segregate layers in Xref files from the ones in the current drawing, the Xref file’s layers are prefixed with their file’s name. A vertical bar separates the filename prefix and the layer name, as in Unitxref Iwall.
• Xrefs cannot be exploded. You can, however, convert an Xref into a block, and then explode it. To do this, you must use the Bind button in the External Reference dialog box. This opens another dialog box that offers two ways of converting an Xref into a block. See the Options in the External Reference Dialog Box section for more information on this dialog box. ‘ If an Xref is renamed or moved to another location on your hard disk, AutoCAD won’t be able to find that file when it opens other files to which the Xref is attached. If this happens, you must use the Browse option in the External Reference dialog box to tell AutpCAD where to find the crossreference file
Xref files are especially useful jh workgroup environments where several people are working on the same project. For example, one person might be updating several files that aye inserted into a va~ety oi~ther files. Using blocks, everyone in the workgroup would have to be notified of the-changes and would have toupdate all the affected blocks in all the drawings that contained them. With cross-referenced files, however, the updating is automatic, so you avoid confusion about which file need to have theirblocks updated.
Other External Reference Options
There are many other features unique to cross-referenced files. Let’s briefly loc’ at some of the other options in the Xref Manager dialog box.
Option:sin the Xref Manager Dialog Box
The following options are found in the main External Reference dialog box. All but the Attach option are available only when an Xref is present in the current drawing? .ts name is selected from the list of Xrefs shown in the main part of the dailog.
Attach Opens the Select Reference dialog box, allowing you to select a file to attach and set the parameters for the .attachment. Detach Detaches an Xref from the current file. The file is then completely disassociated from the current file.
Unload Similar to Detach but maintains a link to the Xref file so that it can be quickly reattached. This has an effect similar to freezing a layer and can reduce redraw, regen, and file-loading times.
Reload Restores an unloaded Xref.
Bind Converts an Xref into a block. Bind offers two options: Bjnd (again) and Insert. Bind’s Bind option maintains the Xref ‘s namedelements (layers, line types, and text and dimension styles) by creating new layers in the current file with the Xref’s filename prefix. The Insert
option does not attempt to maintain the Xref’s named elements but merges them with named elements of the same name in the current file. For example, if both the Xref and the cufrent file have layers of the same name, the objects in the Xr.fare placed in the layers of the same name in the current file. Sr wse Opens the Select New Path dialog box from which you can select a new file or location for a selected Xref. Save Path Saves the file path displayed in the Xref Found At input box. See the Include Path option in the following section. List Viewffree View These two buttons are in the upper-left comer of the Xref Manager dialog box. They let you switch between a List view of v()’ :r Xrefs and a hierarchical Tree view. The Tree view can be helpful in deter-runing how the Xrefs are nested.
The External Reference Dialog Box
Browse Opens the Select Reference File dialog box to allow you to
change the file you are importing as an Xref.
Attachment Causes AutoCAD to include other Xref attachments that are nested in the selected file.
Overlay Causes AutoCAD to ignore other Xref attachments that are nested in the selected file. This avoids multiple attachments of other files and eliminates the possibility of circular references (referencing the current file into itself through another file).
Retain Path Lets you determine whether AutoCAD stores the path information to the Xref in the current drawing’s database, or discards it. If you choose no! to use this option, AutoCAD uses the default file search path to locate the Xref the next time the current file is open. If you plan to send your files to someone else, you may want to turn this option off; otherwise the person you send the file has to duplicate the exact file path structure of your computer before the Xrefs will load properly.
Specify On-Screen Appears in three places. It gives you the option to .enter insertion point, scale factors, and rotation angles within the dialog box or in the Command window, in a way similar to inserting blocks. If you check this option for any of the corresponding parameters, the parameters change to allow input. If they are checked, you are prompted for those parameters after you click OK to close the dialog box. With all three Specify On-Screen check boxes unchecked, the Xref will be inserted in the drawing using the settings .indicated in the dialog box.