Hey guys,
Because we soon going to change our server, all our path will change and so I'm trying to set all my xref-path from absolute to relative path.
I already searched the web for a soultion, but didn't find any good ones, that would help me.
I'd like to do this with lisp, so everytime I open a file it runs this and checks if it and changes the path to relative.
I don't know if there is a easier way to do this for many files at once without opening them...maybe with the referencemanager?
thanks for your help guys!
klingi
I'm using 2014, and this works:
command line:
-xr;T;*:R;
I don't think the pathtype was this easily changed before 2014 though.
That would set all of the xrefs to a relative path in the given file. Keep in mind that this would not "fix" your nested references. You could set this as a button with a macro, or create a stand alone lisp. This function could maybe be added to your acaddoc.lsp so that it runs when you open the file but I'm not sure. I don't like things like to run without my specific input, as there will inevitably be files that you don't want updated.
Another option, that I have no experience with, would be to run a script on your files to fix this all in an automated fashion.
Thank you,
I know that command from acad2014, but we mostly use 2010 and there it doesn't have this solution built in.
So I guess I would need to work with a automated script the runs over all file...
or at least a Lisp the runs everytime I open a file...
Hi klingi,
using AC2010, occur to me two options for accomplish that task...
Please note that the codes are quick and dirty, and were written only to demonstrate a way to accomplish that task...
FULLY UNTESTED!!!
I don´t have AutoCAD in this laptop...
Is advisable to create a dwg's set for testing purposes!
In both options I use Lee Mac's LM:XRef:Full->Relative routine to create the relative path string.
First option:
using a script file with a call to a routine that will change the path, and to process multiple dwg's you can use Autodesk ScriptPro (it's free).
The code is the attached rpath.lsp if the code is pre-loaded (via acaddoc.lisp, or with a load function) the script file can be as simple as:
rpath
<<<< empty line
Second option:
Using ObjectDBX.
Please pay attention that using ObjectDBX environment, the dwg's will lose the preview thumbnail...
To run the attached rpath1.lsp, open a new dwg and run de rpath1, ensuring that none of dwg's to processing is open, the code will process an entire directory.
I would prefer the first option!
HTH
Henrique
Thanks henrique,
I already came across Lee's script will searching trough the net, but didn't get it work.
Now I tried your first method, which already runs over the selected test files with the lisp inclueded, but doesn't seam to work properly:
; error: no function definition: LM:XREF:FULL->RELATIVE
any clue what I'm doing wrong?
cheers Klingi
next problem! 😉
error: to many arguments
I tried to run the Lisp without the script to test it, but it didn't work...
This side. without errors...
Command: appload
rpathV01.LSP successfully loaded.
Command: RPATH
_.qsave
Command:
Henrique
Hi-
Any chance this is working? I have an issue where all of our xrefs are full path but need to be switched all over to relative.
I would love some help on this if possible.
UPDATED:It seems like rpath is working, but only after xref's are reloaded. ANy way to automate this?
THanks in advance.
Attached is my X-PATH.lsp, which will remove absolute paths from both Xrefs and Images if they are found anywhere in the AutoCAD search path, which includes the current drawing's path. It has both error and undo controls.
I personally think that xrefs should reside with their parent drawings. That's why I wrote it.
After loading, use the command either X-PATH or X-P.
John F. Uhden
Hello John,
sorry. It's not working.
@john.uhden wrote:Attached is my X-PATH.lsp, which will remove absolute paths from both Xrefs and Images if they are found anywhere in the AutoCAD search path, which includes the current drawing's path. It has both error and undo controls.
I personally think that xrefs should reside with their parent drawings. That's why I wrote it.
After loading, use the command either X-PATH or X-P.
Could you please describe the symptoms that represent in what way(s) it is not working? Perhaps an error message?
John F. Uhden
The lisp that you attached does not work.
Command: X-PATH
0 xrefs repathed
only that message comes out, and it does not change any absolute path to relative XREFs.
LinkedIn / AutoCAD Certified Professional
Si mi respuesta fue una solución para usted, por favor seleccione "Aceptar Solución", para que también sirva a otro usuarios.
In post #7 I wrote, "Attached is my X-PATH.lsp, which will remove absolute paths from both Xrefs and Images if they are found anywhere in the AutoCAD search path, which includes the current drawing's path."
So if the xrefs were not "found anywhere in the AutoCAD search path, which includes the current drawing's path," then it will not change their paths.
Might it be that you have xrefs scattered around and that you want them to be located in the same folder as the current drawing? That can be done but it would require either copying or moving the xref to the current drawing's folder. My X-PATH routine was not written to do that.
John F. Uhden
You can also try this one which I found and written by: Mark McDonough
Area Object Link |
Attribute Modifier |
Dwg Setup |
Feet-Inch Calculator
Layer Apps |
List on Steroids |
VP Zoom Scales |
Exchange App Store