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

AutoCAD 2007 Xrefs – Relative Paths

I have had so many users who have had troubles with projects and delivering files because they used Hard Coded Paths (Full Path) for Xrefs.

Full Path stores the location of the file that you have attached starting from the drive letter and moving down the tree to where the file is located.

Example:
C:\Documents and Settings\mkiker\My Documents\Acad2007\XREF\Wall Base.dwg

So it starts from the “C” drive – or wherever and travels down the tree to find the DWG file.

If the drive letter changes because you move the project or you send the files to someone else and they do not put the files in the exact locations (including drive letter) that you did – the file does not load in AutoCAD.

Enter Relative Paths…

Relative Paths start from the location of the host file and moves to where the XREF file is located.

Example:
..\XREF\Wall Base.dwg

So it starts looking by backing out of the folder of the host (the two dots) and moves into subfolders to find the XREF.

Both ways will find the file when you first load it. Relative Paths will ensure that the file is found in the future in more cases that Full Path.

Here is where you set it in AutoCAD 2007. Open the XREF palette or Dialog box and look for the Path type option. This only appears when you are actually loading the file the first time. The default is Full Path.

[1]

Here is how to change it once it is set in 2007.

Select the XREF you need to change and highlight the area of the path that you need to change.

[2]

Now – just type in two dots “..” in place of that full path and hit Enter. Be sure to leave the backslash after the two dots. If you have to back up two folders before going into a subfolder the use two sets of dots “..\..”

[3]

It sure would be nice to have a tool inside AutoCAD (not on the Start Menu) that would do this quickly. Do you know of one?

21 Comments (Open | Close)

21 Comments To "AutoCAD 2007 Xrefs – Relative Paths"

#1 Comment By Anonymous On December 12, 2006 @ 8:34 AM

I got excited when I saw this blog title, thinking that maybe AutoCAD 2007 has finally fully implemented relative paths. But I see that they have not, and you’ve given the tip of just backspacing the upper level path info, leaving the appropriate ..\path info. AutoCAD began addressing relative paths with R2004, when attaching an XREF. But there’s no way to easily and automatically convert existing FULL xref paths to relative ones, after the fact.

I find that most users have no clue about how to edit the path manually to strip out the unnecessary part. And if the folder structure is complicated, it can admitted be difficult in figuring this out. CAD veterans from the old DOS days know what ..\ means…. the younger people today have no concept of this.

I wrote an XRP (Xref Relative Path) utility way back in R14 AutoCAD, that automatically converts full XREF and IMAGE paths to be relative. I keep waiting for my utility, written over 7 years ago, to become moot. But I guess I need to hang onto it for a while longer.

Interesting, in an early incarnation of Buzzsaw, they had a Buzzsaw/ProjectPoint plugin for AutoCAD, which was great for automatically posting DWGs up to Buzzsaw. One of the tools in the AutoCAD plugin, was a tool to convert XREF paths to be relative. In some common folder structure situations, the utility failed to appropriately convert the path, but at least it was a good try and the 1st indication that I saw that Autodesk was even aware of the need. It was a short-lived Buzzsaw/AutoCAD plugin, retired not long after the utility was developed.

#2 Comment By CADDManager On December 12, 2006 @ 9:03 AM

I fully endorse XRP – it is a great tool and I have used it extensively.

#3 Comment By Anonymous On December 18, 2006 @ 9:24 AM

Relative pathing is impossible for us! We work on small towns and large theme parks with a dozen disciplines. The only way to keep hundreds of xrefs organized is through a simple but sophisticated folder structure. Relative pathing works in only ONE DIRECTION, that is, it only looks in the dwg’s subfolders to find xrefs. We need AutoCAD to be able to search all subfolders of the root project not just direct subfolders. Currently the root is where the dwg is located, however we suggest that Autodesk allow the root to be the job folder with all subfolders searchable in a relative path. Until this is done it is hard pathing all the way,

#4 Comment By Anonymous On December 26, 2006 @ 11:14 AM

I do not concur with Mr. Penzinger’s statement that “Relative pathing works in only ONE DIRECTION, that is, it only looks in the dwg’s subfolders to find xrefs”. As far as I’m aware, relative pathing works both ways in AutoCAD, in subfolders (below) the current folder location, and in upper level folders above the folder location. It just can’t jump drives, in other words, if an XREF exists on a different drive, then that’s a physical limitation to relative pathing in general.

My XRP.LSP utility does indeed figure relative pathing above, below, or lateral to the current DWG’s folder location. It’ll repath right up to the root directory folder if an XREF or IMAGE file is there. If XREF files are in folders 3 levels above the current folder location, it’ll take the form of ..\..\..\someFolderName.

#5 Comment By Anonymous On December 27, 2006 @ 7:57 AM

I would love to get a hold of XRP.LSP (if it is freely available). If so, would you please tell me where I can download it?

Thanks,
William

#6 Comment By Anonymous On December 27, 2006 @ 6:29 PM

My XRP2004.lsp utility is available from:
[4]\cad\cad_utils.htm or follow this link:
Xrp2004.lsp

#7 Comment By Rupert Penzinger On January 17, 2007 @ 10:57 AM

Mark

I stand corrected, I have not explored relative pathing in Autocad in almost a decade. Either Autocad has been corrected to solve traversing lateral paths or I have just always been wrong. Either way it does seem to traverse lateral paths quite nicely. Thank you for this knowledge. I am seriously considering changing our standard practice. Cheers

#8 Comment By CadDog On October 17, 2007 @ 7:57 AM

I really needed to say something about this topic…
How many times have I open a drawing just to find out that a lot of the xref are not found. Many users like creating a project search path but when you work on as many projects as I and my company does, using that method is just not an option. Using XRP not only frees the users of worrying xref not found it’s also nice to be able to burn CD’s and be able to open a drawing within that CD and still see all the xref attached. AutoCAD has continue (in my opinion) to drop the ball on this one. XRP ROCK…!!!

#9 Comment By Kirsten On May 12, 2008 @ 8:10 PM

CadDog, try using the eTransmit to create a zip to put onto an archive CD. It’s a nice way to archive a drawing and continue to have the xrefs in place.

#10 Comment By Arnout On June 11, 2008 @ 12:44 AM

Use the command REDIR

#11 Comment By timeout On June 25, 2008 @ 2:12 PM

if you simply path to the xref folder in your acad start shortcut, then all xrefs will resolve, regardless of saved path, relative path, or no path.

#12 Comment By Anonymous On October 15, 2008 @ 1:26 AM

In general, relative XRefs are very nice to use when giving your drawings to someone outside. Unfortunately, AutoCAD 2008 still doesn’t handle them correctly. Try this scenario:

Add an xref into the current drawing (any xref would do, but for this just use one in the same folder as the current). Ensure that relative path is enabled (as per above sample). You end up with the XRef path just being the DWG filename. Now, saveas to a different directory. Close & reopen that drawing … the XRef is not found. If you used the full path option, this wouldn’t be a problem.

What I think should happen is that the eTransmit should automatically change all included XRefs to be relative in the transmitted files. Or AutoCAD needs to translate a relative path if saved to a new folder / copied from another drawing.

#13 Comment By Victore On April 28, 2009 @ 12:40 PM

I’ve been using the XRP2004 lisp and i love how it works. We just recently switched from AutoCAD 2007 to AutoCAD 2010 and the lisp doesn’t work anymore. Does anyone have an idea what needs to be modified to make it work in 2010 or have found an updated version?

#14 Comment By antennaria On May 29, 2009 @ 8:18 AM

I have updated XRP14.lsp to work in AutoCAD 2010. Contrary to what my web page says (that it hasn’t been tested in AutoCAD 2010), the utility has been tested in AutoCAD 2010. You can download it from the URL below.

[5]

#15 Comment By Jimmy On June 25, 2009 @ 12:39 AM

Thanks antennaria, I was looking for this!! It works perfectly!

Kind regards,

Jimmy

#16 Comment By TINGUIN On January 6, 2011 @ 1:34 PM

Thanks a ton.

#17 Comment By Michel On March 4, 2011 @ 9:03 AM

That lisp routine is the best, especially for myself who often telecommutes. There was always an issue (repathing everything) when I would work on files outside of the office & then had to redo the paths once back in the office.

Thanks.

#18 Comment By ARUN On March 28, 2011 @ 6:17 AM

I have problem in xref insert window.But only in one file.
In this file when am trying to attach a dwg file the factor value is showing 25 and I cannot change this value. Can anyone help me to solve this problem? How can I change this value from 25 to any number?

#19 Comment By Garci On April 18, 2011 @ 3:34 PM

Hi Antennaria,

Thanks a million for the XRP script. Its a godsend!!! I do have a very small request… we work with a lot of files stores in our shared storage and they are not mapped as regular drives (E:, F:, etc) but straight out of the server name (\\servername\share\etc..). Originally, XRP recognized this as already a relative path and didnt change it. So far, I just hacked it (changed the match pattern from *:* to *\\\\*) and it works, but only for network shares ;-)… is there any chance you could try to get this option in there? I realize this is an awfully old thread, but im totally new at LISP.

Thanks in advance!
Diego

#20 Comment By Eric On May 6, 2011 @ 10:19 AM

Can you include image and sid files to this .lsp?

#21 Comment By Shefqet On January 26, 2012 @ 7:14 AM

use the “redir” to convert the absolute path to a specified one.