Getting Attached with XREFs
Some of you get pretty excited about and have gotten quite attached to AutoCAD®. One way to make your experience even better is to take your attachment to another level by using external file references. If you are not using External References (XREFS), which has been around for a long time, you are really missing out on a powerful tool. If you are a current user, keep reading—maybe you will find some new things covered here that you have been a bit curious about.
Throughout this article I will refer to the process of attaching external reference files as "XREF/XREFING," to the attached files as "XREFs," and to the drawing that you attach XREFs to as the “working drawing.”
What are XREFs?
External references are much like the concept of blocks, which was the old school way of handling many of the functions now provided by external references. Rather than being embedded (inserted) in the file, they are externally ‘attached’ or ‘referenced.’ Items that can be attached include DWGs, PDFs, DGNs, DWFs, and IMAGES (BMP, JPG, TIFF, PNG). Different commands can be used to attach the various external files, and these commands start with the file type and the word "ATTACH.” Examples are PDFATTACH, DGNATTACH, IMAGEATTACH, and DWFATTACH. Or you can just use the XREF command which will allow you to attach any type from one dialog. The individual commands are great for use in automation efforts (Macros, Scripts, and LISP), but will not likely be your first “go to” option.
Why do you XREF?
Because it is the right thing to do, of course! If you are new to AutoCAD and XREFs and wonder what all the fuss is about, XREFs provide a lot of pretty cool features.
• They keep your working file size small
• They allow sharing of files while providing real-time updates
• They are great for coordination
What do you XREF?
As stated above, in what are External References, you see a lot of file types that can be attached to your working drawings. Typical items you that would attach include floor plans, title blocks, logos, standard details, survey pictures, and product literature. But if you have any of the file types above that you commonly share in projects, the options are unlimited.
Why Block Insert When you Can XREF?
The big difference between working on a background that is a block versus a background that is an XREF is that the external XREF can be worked on by someone else and be shared real time with multiple users or files. External references keep your drawing files small and allow you to share the background with multiple drawings.
The following are examples of how XREFs can be used to increase your productivity. The one big advantage of every one of these examples is that when you update the XREF, every file that references it is updated.
This is probably one of the top two uses of external references. In a typical project the one item that is common among all drawings is the title block. By XREFing the title block drawing, you can make changes to the address, issue date, customer info, and logo in one place and have all of your working drawings updated automatically.
Note that the logo in the title block is another common XREF (IMAGEATTACH). You can also enter all your revision info for the entire job in this drawing as individual layers (i.e., REV-1, REV-2, etc.) freeze them in the title block and thaw as necessary in the working drawings.
Probably the top use of XREFs. Through a combination of external references, clipping, and paper space, you can attach multiple plans and plot at different scales all on one sheet.
XREFs can be renamed when attached, and by doing this you can attach the same file multiple times and control the visual aspects of each as if it were a separate file. This is referred to as logical name versus actual name. An example would be attaching a floor plan (FP-1) that has demo and new work layers all in one drawing. By attaching FP-1 and then renaming it in the XREF dialog to FP-Demo, you can freeze and thaw layers as required to show the demo portion of the plan. You then attach (not copy) the FP-1 plan again and freeze and thaw layers as required to show new work. Since each logical XREF has its own layer structure showing up in your layer dialog, you can also change colors and line types.
Note that this feature relies on your VISRETAIN SETVAR being set to "1."
In some jurisdictions it is required that manufacturers’ data, safety information, or product performance be shown on the drawings. Instead of retyping all this data or redrawing it (or creating “sticky backs,” for you old-timers) just XREF the PDF or image files into your working drawings.
Nearly every set of drawings utilizes some form of standard details. You could have a standard detail sheet with the details XREFed so that the sheet is always up-to-date. If you need to revise a standard detail to be job specific or freeze the details specifics from changing during the course of the job, you can bind those details into your working drawing and edit as required within the current job.
When doing renovation projects, a necessary task is to provide enough information on the existing conditions to allow contractors to be able to see what they face so they can give an accurate bid. Although requiring a field visit is always a good idea, it is not always practical for some projects. A great way to enhance your drawings is to IMAGEATTACH field photos in your drawings and add notes detailing the specifics.
When working on large building projects or campus-wide projects, you can attach aerial views or screenshots from your favorite mapping program to visually show your site or campus. For large building projects, you can attach a drawing at a reduced scale of the overall building with hatched areas or layers frozen or thawed to represent specific areas of work.
Any plan changes will automatically update your key plan as the project progresses.
Figure 1: A working drawing with a X_Base drawing (external reference) attached
If you choose the drop-down menu in the upper left (see Figure 2), you will see the variety of file types that can be attached to your working drawing. Because AutoCAD now has so many external attachment options, the “XREF” OR EXTERNALREFENCES” dialog gives you a full picture of all your attachments.
Figure 2: External file attachment options
For daily use, I use the CLASSICXREF command which is “XR” in my shortcut keys to do daily DWG reference functions (see Figure 3).
Figure 3: CLASSICXREF Dialog
Sometimes you may want to make the externally attached files a permanent part of your working drawing, such as for archiving or sharing with another program that does not understand reference files. Note that Images, DWFs, and PDFs cannot be bound.
There are two options for binding external references: Bind and Insert. When choosing the Bind/Bind option, all logical named items in the external reference files get bound with a prefix denoting the original XREF name. These items include layers, linetypes, text styles, blocks, dimension styles, and so on. This can make for a very messy listing of the various types, or very useful depending on your goals. Bind/Insert merges all the items previously mentioned into the working drawings. I typically prefer this binding option as it reduces the clutter in the drawing and makes it easy to do updates.
Below are a couple screenshots showing the difference between the Bind/Bind and the Bind/Insert options:
Layers before Binding
Layers after Bind/Bind
Layers after Bind/Insert
As you can see above, it is much cleaner to use the Bind/Insert option. The additional “$0$” symbology will get added to all your linetypes, text styles, blocks, etc.
NOTE: If you are having trouble getting files to bind, run an audit and purge on the XREFs and the working drawing. That typically does the trick.
A Creative Use
Have you ever inserted your default North arrow symbol and then had other people copy that to their drawings only to find out later that it's in the wrong orientation? Then you have to go back through all the plan sheets and fix the North arrow... Bummer! Think about how many times you have to insert a North arrow and rotate it to the right orientation. What if every project had a North arrow drawing that was oriented properly one time and then everybody just referenced it into each plan sheet. An alternative is to put it in the title block, but then it would not apply if the plan were rotated on a sheet.
Overlays Versus Attachments
AutoCAD has the ability to ‘nest’ XREFs (i.e., attach an XREF that has an XREF attached to it). In the XREF manager (CLASSICXREF) and in the External References dialog, you will see two icons representing two different dialog views. You can see when a XREF is nested using the ‘Tree View.’
The benefit of this feature is that you can stack XREFs for coordination purposes. Assume you are working on a reflected ceiling plan and you need to coordinate diffuser and sprinkler locations with your lights. You can attach the HVAC plan and the sprinkler plan to your file to do your coordination. You can keep these files attached for future change coordination, but hide them from view. In the “XREF Manager” dialog, select the file you wish to hide and choose the Unload button. In the “External References” dialog, right-click the file and select Unload. These functions are all part of the normal nesting function of XREF attachments. There is another attachment option called “Overlay” that allows you to attach an XREF to a file and only allow it to be seen in the current file. Note that this does not work for Images, DWFs, or PDFs. Using the above example for coordination, if the electrical designer wishes to power up the lights, he or she could attach the reflected ceiling plan to the lighting plan to do the circuiting. If the HVAC plan and the sprinkler plan were standard XREFs, that would be seen on the plan as well. If there is no need for that, to avoid possible confusion, the HVAC and sprinkler plans could be attached as Overlays and the electrical designer would not even know they existed.
You can change the reference type on the fly. In the “XREF Manager” dialog, select the file you wish to hide and double-click on the word Attach or Overlay under Type and it will change. In the External References dialog, right-click the file and select Attach, and in the pop-up make your change.
There are a lot of commands and system variables that can be used when using XREFs, but like most other AutoCAD features, you typically need only a few. Below are the most common commands and SETVARS that you would use on a daily basis.
Commonly Used External Reference Commands
REFEDIT – Edit Reference In-Place.
XCLIP – Allows clipping (hiding portions) of the XREF from view. Great for enlarged plans or partial details.
(NOTE: for other file types: PDFCLIP, DGNCLIP, IMAGECLIP, DWFCLIP.)
XBIND – Allows binding of individual items from an external DWG file attachment. Say you want to bring in a
block or linetype from the external reference. Use XBIND to bind it and then rename it if you would like.
Commonly Used External Reference SETVARS
VISRETAIN – Controls visibility, color, linetype, lineweight, and plot styles. Should be set to 1.
XFADECTL – Controls the dimming for all DWG XREF objects. (Fade from 0 – 90 percent, user visual preference).
XREFNOTIFY – Controls the notification for updated or missing XREFs. Should be set to 1 or 2.
XREFTYPE – Controls the default reference type when attaching or overlaying an external reference. This depends on use, but the majority of XREFs will be Attachments, not Overlays. See “Overlays Versus Attachments” earlier in this article.
If you are currently using external references then you have already seen the many advantages they provide. If you are not currently using external references, it’s time to get attached!