PDA

View Full Version : Xref paths



Coolmo
2005-02-09, 08:10 PM
Can anyone tell me how to get rid of the retained Xref path for an attached Xref? When you first attach the Xref it has that little check box next to the name "Retain Path" but once you retain the path it's there. I'd like to be able to run a little lisp routine that would search the current drawing for xrefs and get rid of the path. We're going to a different system for xreffing drawings but the old system keeps looking at the saved path. This being the case, every drawing needs to be changed. Is this possible?

Tom Beauford
2005-02-09, 09:09 PM
Try the Reference Manager, it's a seperate program from Autocad that should have an icon in the same directory group as Autocad in Start => Programs => Autodesk.

Coolmo
2005-02-10, 01:33 PM
No such animal on my side (LDD 2002). Besides, I was hoping I could do it with a quick little lisp routine

Tom Beauford
2005-02-10, 02:15 PM
What sort of system are you going to? Don't know if it will help but this routine by Peter Jamtgaard was designed to update the paths of all xrefs in the drawing to the current directory. I remarked out the part to add the current directory so now it should do what you want, but just to the current drawing. Give it a try.

; Repath all instances of existing xrefs.
; by: Peter Jamtgaard <cordeck@acronet.net>
(defun C:XREPATH (/ CNT ENAM EOBJ SSET )
(vl-load-com)
(vlax-for BLKOBJ
(vla-get-blocks
(vla-get-activedocument
(vlax-get-acad-object)
)
)
(if (= (vla-get-isxref BLKOBJ) :vlax-true)
(progn
(setq SSET (ssget "x" (list (cons 2 (vla-get-name BLKOBJ))))
CNT 0
)
(if SSET
(repeat (sslength SSET)
(setq ENAM (ssname SSET CNT)
CNT (1+ CNT)
EOBJ (vlax-ename->vla-object ENAM)
)
(vla-put-path EOBJ
(strcat
; (getvar "dwgprefix")
(vl-filename-base
(vla-get-path EOBJ)
)
".dwg"
)
)
)
)
)
)
)
(prin1)
)

Coolmo
2005-02-10, 04:20 PM
Currently we have people here in the office who have xrefed drawings from all over the server, which we have found to be very troublesome, so we now have a new "rule" in place that says put all xrefs in the same folder as the drawing pointing to it. The only problem is when the drawing pulls in the xref with a path, if that path and xref still exists it will load that one instead of the one that now resides in the same folder. By taking the pathing out of the xref, it should find the one in the same folder first. I'm aware that we can simply point to another xref and save that path but we're talking about thousands of drawings. A quicky lisp routine to get rid of this path would be ideal so the next time the drawing is opened it would automatically find the right xref. Clear as mud? Sorry I'm so long winded here.

Tom Beauford
2005-02-10, 05:01 PM
Did XREPATH work the way you wanted? You could load and run the routine each time you open a drawing by putting it in the Acaddoc.lsp file.
(load "XREPATH")
(C:XREPATH)
Otherwise you could create a script file to run it on all drawings. With '04 or '05 you could use DBX to operate on all drawings, but if you had one of those you would just use Reference Manager.