- CADDManager Blog - https://www.caddmanager.com/CMB -

CAD Standards and XREFs

XREFs are one of the most powerful and the most confounding tools that AutoCAD and other CAD programs have introduced. Get them right (which is actually easy to do) and your work is much easier and well coordinated. Get them wrong (which can happen) and you can get twisted into a knot so tight that you cannot get out of it.

One of the most important parts of XREFs are the paths that they use to find the files. You can use Hard coded paths or relative paths. Read more about these options here [1].

So here are some thing you could add to your CAD Standard about creating and using XREFs.

Xref Path Names

All Reference file attachments will be saved using relative paths. Relative paths do not include the drive letter and reflect the location of the reference file as it relates to the active file.

Relative path names can be created in AutoCAD by using a shareware program called XRP. AutoCAD 2004 and beyond has a variable setting to allow for relative paths.

Reference files shall be added on a specific layer and the prefix for that layer shall be “$xref-“ followed by the reference file name. “$nref-” shall be used as a prefix when attaching nested reference files to model files.

Only use one level of nesting. Do not overuse nested reference files. Attaching a file to create a Nested XREF should only be done on Model files. Do not create nesting on Sheet files.

The lisp routine “XRP” will correct the hard coded paths to relative paths in AutoCAD 14 thru 2010. AutoCAD 2004 and beyond allows for attachments with relative paths. It must be done at the time of attachment or fixed with XRP after the fact. Get XRP [2] – you need it.

5 Comments (Open | Close)

5 Comments To "CAD Standards and XREFs"

#1 Comment By JJ On July 21, 2009 @ 1:18 AM

Can anyone tell me why relative path is sometimes not allowed??

#2 Comment By CADDManager On July 28, 2009 @ 6:43 AM

If you mean that it will not allow you to check the box…

I have seen it do this if the file was just attached and you forgot to check the box before attaching. Not sure why this happens.

Download XRP and run that – it will fix it.

[2]

#3 Comment By matthew On August 18, 2009 @ 10:33 AM

if the file u are attempting to reference an XRef into is not saved, it will not allow you to use relative path, as it can not create a directory base point to start from.

#4 Comment By CADDManager On August 18, 2009 @ 12:11 PM

This is true. You must save the file after the attachment at least once. Then run XRP.

#5 Comment By mixue On August 4, 2010 @ 9:49 PM

hi, i just started learning how to create lsp and i have a problem creating an lsp command “defun c:xn” that moves a selected x-ref to layer “la-xref” and identify xref name in the command line.
And a separate command “defun c:xx” to load and unload a selected xref.