Jump to content

Batch change xref names and repath dwgs


JeepMaster

Recommended Posts

Try this:

 

Start --> Programs --> Autodesk --> AutoCAD 20xx --> Reference Manager

 

I designed an application to cater for these needs and then discovered this Autodesk freebie so abandoned my plans.

 

Hope this helps.

Wannabe,

Reference manager only repath the same xrefs, it doesn't work if the xrefs have a different name, which this lisp will do. (ie: xref FP00.dwg renamed to FP01.dwg)

Link to comment
Share on other sites

  • Replies 43
  • Created
  • Last Reply

Top Posters In This Topic

  • JeepMaster

    12

  • ronjonp

    10

  • Lee Mac

    6

  • RyanGC

    5

Top Posters In This Topic

Posted Images

I've now combined both blkrenamer lisp and the path change lisp from rjp. So if the path changed as well as name changed, it will still work. I kept the xref reload lisp in there because it seems to need it after the pathchange lisp from rjp. Here's what I have now. Hope others will find it useful. I tried to make it as clear as possible of how to modify the lisp for individual use.:D

;...............................................................................
;
;      << Replace old xref files with a set of new xref files >>
;                    
;                           << Version 1.0 >>
;                     
;       NOTE: If new xrefs are in a different folder, you must call out
;             XrefPathChange.lsp from the code below.
;
;...............................................................................

(defun c:xrefnamechange (/ b bcol path)
 (setq bcol (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))))
 (foreach blk '(
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;>>>>>  Enter all xref names below in this format  >>>>>>
;>>>>>  ("OldXrefName" . "NewXrefName")            >>>>>>
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

   ("fp01" . "fp01_new")
   ("ABC" . "ABC_new")

;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
   )
   (if
     (and 
      (not (vl-catch-all-error-p (setq b (vl-catch-all-apply 'vla-item (list bcol (car blk))))))
      (= (vla-get-isxref b) :vlax-true)
     )
      (progn (vla-put-name b (cdr blk))
         (if (= (setq path (vl-filename-directory (vla-get-path b))) "")
       (vla-put-path b (strcat (cdr blk) ".dwg"))
       (vla-put-path b (strcat path "\\" (cdr blk) ".dwg"))
         )
       (vla-reload b)
      )
   )
 )
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;>>>                    XrefPathChange.lsp call out here.                       >>>>
;>>>           Enter all xref paths to be changed in this format.               >>>>
;>>>  (xrefpathchange "c:\\Oldfolder\\oldfolder" "c:\\newfolder\\newfolder")    >>>>
;>>>              Note: Remove code if new xref path is unchanged.              >>>>
;>>>                  Add ; infront of each line to block code.                 >>>>
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

(xrefpathchange "L:\\Buildings\\E" "c:\\temp\\new xref")
(xrefpathchange "L:\\Buildings\\A" "c:\\temp\\new xref")

(XReload)
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
(princ)
);end of c:XrefNameChange



;...........................................................
;....        Xref Path Change sub routine by ronjonp    ......
;...........................................................
(defun xrefpathchange (path1 path2 / newpath xrpath)
 (vl-load-com)
 (vlax-map-collection
   (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))
   (function
     (lambda (x)
       (if (= (vla-get-isxref x) :vlax-true)
         (progn (setq xrpath (strcase (vlax-get x 'path) t)
                      path1  (strcase path1 t)
                      path2  (strcase path2 t)
                )
                (if (and (vl-string-search path1 xrpath)
                         (setq newpath (vl-string-subst path2 path1 xrpath))
                         (findfile newpath)
                    )
                  (if (vl-catch-all-error-p (vl-catch-all-apply 'vla-put-path (list x newpath)))
                    (princ (strcat "\n**OLD path found but was not changed!\n" xrpath))
                    (princ (strcat "\n" newpath))
                  )
                )
         )
       )
     )
   )
 )
 (princ)
); end of XrefPathChange


;.............................................................
;....          Xref Reload sub routine                 .......
;.............................................................
(defun XReload (/ cObj cName); Updated 2007-10-1: added error trap
 
 (defun *error*(msg)
   (setvar "modemacro" ".")
   (setvar "cmdecho" 1)
   (princ "\n...Reload xref terminated!!!  ")
   (princ)
   ); end of *error*

 (setvar "modemacro" "Reloading loaded xrefs......please wait......")
 (setvar "cmdecho" 0)
 (setq cObj(tblnext "BLOCK" T))
 (while cObj
   (setq cName(cdr(assoc 2 cObj)))
   (if
     (and
    (=(logand(cdr(assoc 70 cObj))32)32)
    (=(logand(cdr(assoc 70 cObj))4)4)
    ); end and
     (progn
      (vl-cmdf "_.xref" "_unload" cName)
      (vl-cmdf "_.xref" "_reload" cName)
      ); end progn
     ); wnd if
 (setq cObj(tblnext "BLOCK"))
 ); end while
 (setvar "modemacro" ".")
 (setvar "cmdecho" 1)
 (prompt "\n--- Xref change finished! ---")
 (princ)
 ); end of XReload

Link to comment
Share on other sites

  • 10 months later...
I've now combined both blkrenamer lisp and the path change lisp from rjp. So if the path changed as well as name changed, it will still work. I kept the xref reload lisp in there because it seems to need it after the pathchange lisp from rjp. Here's what I have now. Hope others will find it useful. I tried to make it as clear as possible of how to modify the lisp for individual use.:D

;...............................................................................
;
;      << Replace old xref files with a set of new xref files >>
;                    
;                           << Version 1.0 >>
;                     
;       NOTE: If new xrefs are in a different folder, you must call out
;             XrefPathChange.lsp from the code below.
;
;...............................................................................

(defun c:xrefnamechange (/ b bcol path)
 (setq bcol (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))))
 (foreach blk '(
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;>>>>>  Enter all xref names below in this format  >>>>>>
;>>>>>  ("OldXrefName" . "NewXrefName")            >>>>>>
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

   ("fp01" . "fp01_new")
   ("ABC" . "ABC_new")

;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
   )
   (if
     (and 
      (not (vl-catch-all-error-p (setq b (vl-catch-all-apply 'vla-item (list bcol (car blk))))))
      (= (vla-get-isxref b) :vlax-true)
     )
      (progn (vla-put-name b (cdr blk))
         (if (= (setq path (vl-filename-directory (vla-get-path b))) "")
       (vla-put-path b (strcat (cdr blk) ".dwg"))
       (vla-put-path b (strcat path "\\" (cdr blk) ".dwg"))
         )
       (vla-reload b)
      )
   )
 )
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;>>>                    XrefPathChange.lsp call out here.                       >>>>
;>>>           Enter all xref paths to be changed in this format.               >>>>
;>>>  (xrefpathchange "c:\\Oldfolder\\oldfolder" "c:\\newfolder\\newfolder")    >>>>
;>>>              Note: Remove code if new xref path is unchanged.              >>>>
;>>>                  Add ; infront of each line to block code.                 >>>>
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

(xrefpathchange "L:\\Buildings\\E" "c:\\temp\\new xref")
(xrefpathchange "L:\\Buildings\\A" "c:\\temp\\new xref")

(XReload)
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
(princ)
);end of c:XrefNameChange



;...........................................................
;....        Xref Path Change sub routine by ronjonp    ......
;...........................................................
(defun xrefpathchange (path1 path2 / newpath xrpath)
 (vl-load-com)
 (vlax-map-collection
   (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))
   (function
     (lambda (x)
       (if (= (vla-get-isxref x) :vlax-true)
         (progn (setq xrpath (strcase (vlax-get x 'path) t)
                      path1  (strcase path1 t)
                      path2  (strcase path2 t)
                )
                (if (and (vl-string-search path1 xrpath)
                         (setq newpath (vl-string-subst path2 path1 xrpath))
                         (findfile newpath)
                    )
                  (if (vl-catch-all-error-p (vl-catch-all-apply 'vla-put-path (list x newpath)))
                    (princ (strcat "\n**OLD path found but was not changed!\n" xrpath))
                    (princ (strcat "\n" newpath))
                  )
                )
         )
       )
     )
   )
 )
 (princ)
); end of XrefPathChange


;.............................................................
;....          Xref Reload sub routine                 .......
;.............................................................
(defun XReload (/ cObj cName); Updated 2007-10-1: added error trap
 
 (defun *error*(msg)
   (setvar "modemacro" ".")
   (setvar "cmdecho" 1)
   (princ "\n...Reload xref terminated!!!  ")
   (princ)
   ); end of *error*

 (setvar "modemacro" "Reloading loaded xrefs......please wait......")
 (setvar "cmdecho" 0)
 (setq cObj(tblnext "BLOCK" T))
 (while cObj
   (setq cName(cdr(assoc 2 cObj)))
   (if
     (and
    (=(logand(cdr(assoc 70 cObj))32)32)
    (=(logand(cdr(assoc 70 cObj))4)4)
    ); end and
     (progn
      (vl-cmdf "_.xref" "_unload" cName)
      (vl-cmdf "_.xref" "_reload" cName)
      ); end progn
     ); wnd if
 (setq cObj(tblnext "BLOCK"))
 ); end while
 (setvar "modemacro" ".")
 (setvar "cmdecho" 1)
 (prompt "\n--- Xref change finished! ---")
 (princ)
 ); end of XReload

 

Ouch! This program is giving me the line:

 

; error: no function definition: VLAX-GET-ACAD-OBJECT

 

Any help, anyone?

 

BTW, I'll say thanks, in advance (for when I get it working), for the great programming, JeepMaster, ronjonp & Lee. Cheers.

Link to comment
Share on other sites

For those who may be interested, this program does not appear to work with files referenced with relative paths, only full paths.

 

Modification possible?

Link to comment
Share on other sites

I'm testing this program, in order to better my programming understanding, and it works "out-of-the-box" when the xrefs are renamed, but their paths unchanged.

 

However, when I attempt to rename & change the paths, I get the following command line error:

 

; error: Automation Error. File access error

Here's my modifications (added (vl-load-com), names & paths only!) to the program for testing

 

;...............................................................................
;
;      << Replace old xref files with a set of new xref files >>
;                    
;                           << Version 1.0 >>
;                     
;       NOTE: If new xrefs are in a different folder, you must call out
;             XrefPathChange.lsp from the code below.
;
;...............................................................................

(defun c:xrefnamechange (/ b bcol path )
 [color=Blue](vl-load-com)[/color]
 (setq bcol (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))))
 (foreach blk '(
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;>>>>>  Enter all xref names below in this format  >>>>>>
;>>>>>  ("OldXrefName" . "NewXrefName")            >>>>>>
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

[color=Red]    ("X-TEST-1a" . "X-TEST-1b")
   ("X-TEST-2a" . "X-TEST-2b")
   ("X-TEST-3a" . "X-TEST-3b")[/color]

;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
   )
   (if
     (and 
      (not (vl-catch-all-error-p (setq b (vl-catch-all-apply 'vla-item (list bcol (car blk))))))
      (= (vla-get-isxref b) :vlax-true)
     )
      (progn (vla-put-name b (cdr blk))
         (if (= (setq path (vl-filename-directory (vla-get-path b))) "")
       (vla-put-path b (strcat (cdr blk) ".dwg"))
       (vla-put-path b (strcat path "\\" (cdr blk) ".dwg"))
         )
       (vla-reload b)
      )
   )
 )
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;>>>                    XrefPathChange.lsp call out here.                       >>>>
;>>>           Enter all xref paths to be changed in this format.               >>>>
;>>>  (xrefpathchange "c:\\Oldfolder\\oldfolder" "c:\\newfolder\\newfolder")    >>>>
;>>>              Note: Remove code if new xref path is unchanged.              >>>>
;>>>                  Add ; infront of each line to block code.                 >>>>
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

[color=Red](xrefpathchange "c:\\AutoCAD Customisation" "c:\\AutoCAD Customisation\\Working")
(xrefpathchange "c:\\AutoCAD Customisation" "c:\\AutoCAD Customisation\\Working")
(xrefpathchange "c:\\AutoCAD Customisation" "c:\\AutoCAD Customisation\\Working")[/color]

(XReload)
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
(princ)
);end of c:XrefNameChange



;...........................................................
;....        Xref Path Change sub routine by ronjonp    ....
;...........................................................
(defun xrefpathchange (path1 path2 / newpath xrpath)
 (vl-load-com)
 (vlax-map-collection
   (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))
   (function
     (lambda (x)
       (if (= (vla-get-isxref x) :vlax-true)
         (progn (setq xrpath (strcase (vlax-get x 'path) t)
                      path1  (strcase path1 t)
                      path2  (strcase path2 t)
                )
                (if (and (vl-string-search path1 xrpath)
                         (setq newpath (vl-string-subst path2 path1 xrpath))
                         (findfile newpath)
                    )
                  (if (vl-catch-all-error-p (vl-catch-all-apply 'vla-put-path (list x newpath)))
                    (princ (strcat "\n**OLD path found but was not changed!\n" xrpath))
                    (princ (strcat "\n" newpath))
                  )
                )
         )
       )
     )
   )
 )
 (princ)
); end of XrefPathChange


;.............................................................
;....          Xref Reload sub routine                 .......
;.............................................................
(defun XReload (/ cObj cName); Updated 2007-10-1: added error trap
 
 (defun *error*(msg)
   (setvar "modemacro" ".")
   (setvar "cmdecho" 1)
   (princ "\n...Reload xref terminated!!!  ")
   (princ)
   ); end of *error*

 (setvar "modemacro" "Reloading loaded xrefs......please wait......")
 (setvar "cmdecho" 0)
 (setq cObj(tblnext "BLOCK" T))
 (while cObj
   (setq cName(cdr(assoc 2 cObj)))
   (if
     (and
    (=(logand(cdr(assoc 70 cObj))32)32)
    (=(logand(cdr(assoc 70 cObj))4)4)
    ); end and
     (progn
      (vl-cmdf "_.xref" "_unload" cName)
      (vl-cmdf "_.xref" "_reload" cName)
      ); end progn
     ); wnd if
 (setq cObj(tblnext "BLOCK"))
 ); end while
 (setvar "modemacro" ".")
 (setvar "cmdecho" 1)
 (prompt "\n--- Xref change finished! ---")
 (princ)
 ); end of XReload

 

Any help???

Link to comment
Share on other sites

RyanGC,

I don't know what that "File access error" means. Do you have those xrefs open? I tested my code many times and it's been working great with xref name changed as well as path changed.

 

Our company only use full path, so I never have to deal with relative paths xrefs.

Link to comment
Share on other sites

I'm testing this program, in order to better my programming understanding, and it works "out-of-the-box" when the xrefs are renamed, but their paths unchanged.

 

However, when I attempt to rename & change the paths, I get the following command line error:

 

; error: Automation Error. File access error

Here's my modifications (added (vl-load-com), names & paths only!) to the program for testing

 

;...............................................................................
;
;      << Replace old xref files with a set of new xref files >>
;                    
;                           << Version 1.0 >>
;                     
;       NOTE: If new xrefs are in a different folder, you must call out
;             XrefPathChange.lsp from the code below.
;
;...............................................................................

(defun c:xrefnamechange (/ b bcol path )
 [color=Blue](vl-load-com)[/color]
 (setq bcol (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))))
 (foreach blk '(
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;>>>>>  Enter all xref names below in this format  >>>>>>
;>>>>>  ("OldXrefName" . "NewXrefName")            >>>>>>
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

[color=Red]    ("X-TEST-1a" . "X-TEST-1b")
   ("X-TEST-2a" . "X-TEST-2b")
   ("X-TEST-3a" . "X-TEST-3b")[/color]

;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
   )
   (if
     (and 
      (not (vl-catch-all-error-p (setq b (vl-catch-all-apply 'vla-item (list bcol (car blk))))))
      (= (vla-get-isxref b) :vlax-true)
     )
      (progn (vla-put-name b (cdr blk))
         (if (= (setq path (vl-filename-directory (vla-get-path b))) "")
       (vla-put-path b (strcat (cdr blk) ".dwg"))
       (vla-put-path b (strcat path "\\" (cdr blk) ".dwg"))
         )
       (vla-reload b)
      )
   )
 )
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;>>>                    XrefPathChange.lsp call out here.                       >>>>
;>>>           Enter all xref paths to be changed in this format.               >>>>
;>>>  (xrefpathchange "c:\\Oldfolder\\oldfolder" "c:\\newfolder\\newfolder")    >>>>
;>>>              Note: Remove code if new xref path is unchanged.              >>>>
;>>>                  Add ; infront of each line to block code.                 >>>>
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

[color=Red](xrefpathchange "c:\\AutoCAD Customisation" "c:\\AutoCAD Customisation\\Working")
(xrefpathchange "c:\\AutoCAD Customisation" "c:\\AutoCAD Customisation\\Working")
(xrefpathchange "c:\\AutoCAD Customisation" "c:\\AutoCAD Customisation\\Working")[/color]

(XReload)
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
(princ)
);end of c:XrefNameChange



;...........................................................
;....        Xref Path Change sub routine by ronjonp    ....
;...........................................................
(defun xrefpathchange (path1 path2 / newpath xrpath)
 (vl-load-com)
 (vlax-map-collection
   (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))
   (function
     (lambda (x)
       (if (= (vla-get-isxref x) :vlax-true)
         (progn (setq xrpath (strcase (vlax-get x 'path) t)
                      path1  (strcase path1 t)
                      path2  (strcase path2 t)
                )
                (if (and (vl-string-search path1 xrpath)
                         (setq newpath (vl-string-subst path2 path1 xrpath))
                         (findfile newpath)
                    )
                  (if (vl-catch-all-error-p (vl-catch-all-apply 'vla-put-path (list x newpath)))
                    (princ (strcat "\n**OLD path found but was not changed!\n" xrpath))
                    (princ (strcat "\n" newpath))
                  )
                )
         )
       )
     )
   )
 )
 (princ)
); end of XrefPathChange


;.............................................................
;....          Xref Reload sub routine                 .......
;.............................................................
(defun XReload (/ cObj cName); Updated 2007-10-1: added error trap
 
 (defun *error*(msg)
   (setvar "modemacro" ".")
   (setvar "cmdecho" 1)
   (princ "\n...Reload xref terminated!!!  ")
   (princ)
   ); end of *error*

 (setvar "modemacro" "Reloading loaded xrefs......please wait......")
 (setvar "cmdecho" 0)
 (setq cObj(tblnext "BLOCK" T))
 (while cObj
   (setq cName(cdr(assoc 2 cObj)))
   (if
     (and
    (=(logand(cdr(assoc 70 cObj))32)32)
    (=(logand(cdr(assoc 70 cObj))4)4)
    ); end and
     (progn
      (vl-cmdf "_.xref" "_unload" cName)
      (vl-cmdf "_.xref" "_reload" cName)
      ); end progn
     ); wnd if
 (setq cObj(tblnext "BLOCK"))
 ); end while
 (setvar "modemacro" ".")
 (setvar "cmdecho" 1)
 (prompt "\n--- Xref change finished! ---")
 (princ)
 ); end of XReload

 

Any help???

Something from Autodesk on that subject. http://through-the-interface.typepad.com/through_the_interface/2006/08/handling_automa.html

 

I hope its helpful.

Link to comment
Share on other sites

RyanGC,

I don't know what that "File access error" means. Do you have those xrefs open? I tested my code many times and it's been working great with xref name changed as well as path changed.

 

Our company only use full path, so I never have to deal with relative paths xrefs.

 

The xrefs are not open. I've tried this is in several different directory setups, to eliminate the possibility that I didn't have "full" access to original test directories, but I don't think this is the problem. I get the impression, after reading another forum thread that "maybe" similar, that this problem has something to do with the loading and access to ARX files...

Link to comment
Share on other sites

  • 3 years later...
I've now combined both blkrenamer lisp and the path change lisp from rjp. So if the path changed as well as name changed, it will still work. I kept the xref reload lisp in there because it seems to need it after the pathchange lisp from rjp. Here's what I have now. Hope others will find it useful. I tried to make it as clear as possible of how to modify the lisp for individual use.:D

;...............................................................................
;
;      << Replace old xref files with a set of new xref files >>
;                    
;                           << Version 1.0 >>
;                     
;       NOTE: If new xrefs are in a different folder, you must call out
;             XrefPathChange.lsp from the code below.
;
;...............................................................................

(defun c:xrefnamechange (/ b bcol path)
 (setq bcol (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))))
 (foreach blk '(
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;>>>>>  Enter all xref names below in this format  >>>>>>
;>>>>>  ("OldXrefName" . "NewXrefName")            >>>>>>
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

   ("fp01" . "fp01_new")
   ("ABC" . "ABC_new")

;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
   )
   (if
     (and 
      (not (vl-catch-all-error-p (setq b (vl-catch-all-apply 'vla-item (list bcol (car blk))))))
      (= (vla-get-isxref b) :vlax-true)
     )
      (progn (vla-put-name b (cdr blk))
         (if (= (setq path (vl-filename-directory (vla-get-path b))) "")
       (vla-put-path b (strcat (cdr blk) ".dwg"))
       (vla-put-path b (strcat path "\\" (cdr blk) ".dwg"))
         )
       (vla-reload b)
      )
   )
 )
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;>>>                    XrefPathChange.lsp call out here.                       >>>>
;>>>           Enter all xref paths to be changed in this format.               >>>>
;>>>  (xrefpathchange "c:\\Oldfolder\\oldfolder" "c:\\newfolder\\newfolder")    >>>>
;>>>              Note: Remove code if new xref path is unchanged.              >>>>
;>>>                  Add ; infront of each line to block code.                 >>>>
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

(xrefpathchange "L:\\Buildings\\E" "c:\\temp\\new xref")
(xrefpathchange "L:\\Buildings\\A" "c:\\temp\\new xref")

(XReload)
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
(princ)
);end of c:XrefNameChange



;...........................................................
;....        Xref Path Change sub routine by ronjonp    ......
;...........................................................
(defun xrefpathchange (path1 path2 / newpath xrpath)
 (vl-load-com)
 (vlax-map-collection
   (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))
   (function
     (lambda (x)
       (if (= (vla-get-isxref x) :vlax-true)
         (progn (setq xrpath (strcase (vlax-get x 'path) t)
                      path1  (strcase path1 t)
                      path2  (strcase path2 t)
                )
                (if (and (vl-string-search path1 xrpath)
                         (setq newpath (vl-string-subst path2 path1 xrpath))
                         (findfile newpath)
                    )
                  (if (vl-catch-all-error-p (vl-catch-all-apply 'vla-put-path (list x newpath)))
                    (princ (strcat "\n**OLD path found but was not changed!\n" xrpath))
                    (princ (strcat "\n" newpath))
                  )
                )
         )
       )
     )
   )
 )
 (princ)
); end of XrefPathChange


;.............................................................
;....          Xref Reload sub routine                 .......
;.............................................................
(defun XReload (/ cObj cName); Updated 2007-10-1: added error trap
 
 (defun *error*(msg)
   (setvar "modemacro" ".")
   (setvar "cmdecho" 1)
   (princ "\n...Reload xref terminated!!!  ")
   (princ)
   ); end of *error*

 (setvar "modemacro" "Reloading loaded xrefs......please wait......")
 (setvar "cmdecho" 0)
 (setq cObj(tblnext "BLOCK" T))
 (while cObj
   (setq cName(cdr(assoc 2 cObj)))
   (if
     (and
    (=(logand(cdr(assoc 70 cObj))32)32)
    (=(logand(cdr(assoc 70 cObj))4)4)
    ); end and
     (progn
      (vl-cmdf "_.xref" "_unload" cName)
      (vl-cmdf "_.xref" "_reload" cName)
      ); end progn
     ); wnd if
 (setq cObj(tblnext "BLOCK"))
 ); end while
 (setvar "modemacro" ".")
 (setvar "cmdecho" 1)
 (prompt "\n--- Xref change finished! ---")
 (princ)
 ); end of XReload

Based on a problem we found today regarding Copy Design of drawings in Vault Professional....

 

I thought I had a decent workaround using this lisp, however it didn't work.

 

The plan involved (in Vault) the auto-renumbering a folder of drawing files to suit the new project, which involved the re-pathing and renaming of the drawings master xrefs (because Vault wont accept identical file-names for good reason).

 

The Vault part of the process worked reasonably well, and although I didn't seem to get any error messages, the lisp itself didn't actually rename any of the 'replacement' Xrefs on checking the (checked out from Vault) drawings on C drive.

 

I double checked the "Old Path"..."New Path" and the "Old Name"...."New name"....and they seemed fine?

 

Old Paths/New path:

"c:\Vault\Designs\012 - ARR\0500\GA\Xref" "c:\Vault\Designs\STD - Project\0100\GA\Xref"

"c:\Vault\Designs\012 - ARR\0500\GA" "c:\Vault\Designs\STD - Project\0100\GA"

 

Old Xrefs/New Xrefs:

"XREF ARR Site Plan.dwg" "XREF GEN Site Plan.dwg"

"012-0500-AG-0004.dwg" "STD-0100-AG-0004.dwg"

"012-0500-AG-0006.dwg" "STD-0100-AG-0006.dwg"

 

Anybody had any luck with this? Or does anyone know of a working 3rd party tool for achieving this re-path/rename of an identical Xref?

 

Any suggestions would be appreciated.

 

Cheers

 

DP

Link to comment
Share on other sites

Im surprise this thread is still alive. Can you post the actual code that you used? I see a few errors on your naming format from what you wrote if that's what you entered.

Link to comment
Share on other sites

Im surprise this thread is still alive. Can you post the actual code that you used? I see a few errors on your naming format from what you wrote if that's what you entered.

 

Yep, entered it differently in the lisp....:)

 

;...............................................................................
;
;      << Replace old xref files with a set of new xref files >>
;                    
;                           << Version 1.0 >>
;                     
;       NOTE: If new xrefs are in a different folder, you must call out
;             XrefPathChange.lsp from the code below.
;
;...............................................................................

(defun c:xrefnamechange (/ b bcol path)
 (setq bcol (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))))
 (foreach blk '(
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;>>>>>  Enter all xref names below in this format  >>>>>>
;>>>>>  ("OldXrefName" . "NewXrefName")            >>>>>>
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

   ("XREF ARR Site Plan.dwg" "XREF GEN Site Plan.dwg")
   ("012-0500-AG-0004.dwg" "STD-0100-AG-0004.dwg")
   ("012-0500-AG-0006.dwg" "STD-0100-AG-0006.dwg")

;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
   )
   (if
     (and 
      (not (vl-catch-all-error-p (setq b (vl-catch-all-apply 'vla-item (list bcol (car blk))))))
      (= (vla-get-isxref b) :vlax-true)
     )
      (progn (vla-put-name b (cdr blk))
         (if (= (setq path (vl-filename-directory (vla-get-path b))) "")
       (vla-put-path b (strcat (cdr blk) ".dwg"))
       (vla-put-path b (strcat path "\\" (cdr blk) ".dwg"))
         )
       (vla-reload b)
      )
   )
 )
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;>>>                    XrefPathChange.lsp call out here.                       >>>>
;>>>           Enter all xref paths to be changed in this format.               >>>>
;>>>  (xrefpathchange "c:\\Oldfolder\\oldfolder" "c:\\newfolder\\newfolder")    >>>>
;>>>              Note: Remove code if new xref path is unchanged.              >>>>
;>>>                  Add ; infront of each line to block code.                 >>>>
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

(xrefpathchange "c:\\Vault\\Designs\\012 - ARR\\0500\\GA\\Xref" "c:\\Vault\\Designs\\STD - Project\\0100\\GA\\Xref")
(xrefpathchange "c:\\Vault\\Designs\\012 - ARR\\0500\\GA" "c:\\Vault\\Designs\\STD - Project\\0100\\GA")

(XReload)
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
(princ)
);end of c:XrefNameChange



;...........................................................
;....        Xref Path Change sub routine by ronjonp    ......
;...........................................................
(defun xrefpathchange (path1 path2 / newpath xrpath)
 (vl-load-com)
 (vlax-map-collection
   (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))
   (function
     (lambda (x)
       (if (= (vla-get-isxref x) :vlax-true)
         (progn (setq xrpath (strcase (vlax-get x 'path) t)
                      path1  (strcase path1 t)
                      path2  (strcase path2 t)
                )
                (if (and (vl-string-search path1 xrpath)
                         (setq newpath (vl-string-subst path2 path1 xrpath))
                         (findfile newpath)
                    )
                  (if (vl-catch-all-error-p (vl-catch-all-apply 'vla-put-path (list x newpath)))
                    (princ (strcat "\n**OLD path found but was not changed!\n" xrpath))
                    (princ (strcat "\n" newpath))
                  )
                )
         )
       )
     )
   )
 )
 (princ)
); end of XrefPathChange


;.............................................................
;....          Xref Reload sub routine                 .......
;.............................................................
(defun XReload (/ cObj cName); Updated 2007-10-1: added error trap
 
 (defun *error*(msg)
   (setvar "modemacro" ".")
   (setvar "cmdecho" 1)
   (princ "\n...Reload xref terminated!!!  ")
   (princ)
   ); end of *error*

 (setvar "modemacro" "Reloading loaded xrefs......please wait......")
 (setvar "cmdecho" 0)
 (setq cObj(tblnext "BLOCK" T))
 (while cObj
   (setq cName(cdr(assoc 2 cObj)))
   (if
     (and
    (=(logand(cdr(assoc 70 cObj))32)32)
    (=(logand(cdr(assoc 70 cObj))4)4)
    ); end and
     (progn
      (vl-cmdf "_.xref" "_unload" cName)
      (vl-cmdf "_.xref" "_reload" cName)
      ); end progn
     ); wnd if
 (setq cObj(tblnext "BLOCK"))
 ); end while
 (setvar "modemacro" ".")
 (setvar "cmdecho" 1)
 (prompt "\n--- Xref change finished! ---")
 (princ)
 ); end of XReload

Link to comment
Share on other sites

Its missing a "." In between the names. I also added (vl-load-com) to the beginning ng of the code. Try this and see if it makes any difference.

 

;...............................................................................
;
;      << Replace old xref files with a set of new xref files >>
;                    
;                           << Version 1.0 >>
;                     
;       NOTE: If new xrefs are in a different folder, you must call out
;             XrefPathChange.lsp from the code below.
;
;...............................................................................

(defun c:xrefnamechange (/ b bcol path)
 (vl-load-com)
 (setq bcol (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))))
 (foreach blk '(
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;>>>>>  Enter all xref names below in this format  >>>>>>
;>>>>>  ("OldXrefName" . "NewXrefName")            >>>>>>
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

   ("XREF ARR Site Plan.dwg" . "XREF GEN Site Plan.dwg")
   ("012-0500-AG-0004.dwg" . "STD-0100-AG-0004.dwg")
   ("012-0500-AG-0006.dwg" . "STD-0100-AG-0006.dwg")

;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
   )
   (if
     (and 
      (not (vl-catch-all-error-p (setq b (vl-catch-all-apply 'vla-item (list bcol (car blk))))))
      (= (vla-get-isxref b) :vlax-true)
     )
      (progn (vla-put-name b (cdr blk))
         (if (= (setq path (vl-filename-directory (vla-get-path b))) "")
       (vla-put-path b (strcat (cdr blk) ".dwg"))
       (vla-put-path b (strcat path "\\" (cdr blk) ".dwg"))
         )
       (vla-reload b)
      )
   )
 )
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;>>>                    XrefPathChange.lsp call out here.                       >>>>
;>>>           Enter all xref paths to be changed in this format.               >>>>
;>>>  (xrefpathchange "c:\\Oldfolder\\oldfolder" "c:\\newfolder\\newfolder")    >>>>
;>>>              Note: Remove code if new xref path is unchanged.              >>>>
;>>>                  Add ; infront of each line to block code.                 >>>>
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

(xrefpathchange "c:\\Vault\\Designs\\012 - ARR\\0500\\GA\\Xref" "c:\\Vault\\Designs\\STD - Project\\0100\\GA\\Xref")
(xrefpathchange "c:\\Vault\\Designs\\012 - ARR\\0500\\GA" "c:\\Vault\\Designs\\STD - Project\\0100\\GA")

(XReload)
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
(princ)
);end of c:XrefNameChange



;...........................................................
;....        Xref Path Change sub routine by ronjonp    ......
;...........................................................
(defun xrefpathchange (path1 path2 / newpath xrpath)
 (vl-load-com)
 (vlax-map-collection
   (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))
   (function
     (lambda (x)
       (if (= (vla-get-isxref x) :vlax-true)
         (progn (setq xrpath (strcase (vlax-get x 'path) t)
                      path1  (strcase path1 t)
                      path2  (strcase path2 t)
                )
                (if (and (vl-string-search path1 xrpath)
                         (setq newpath (vl-string-subst path2 path1 xrpath))
                         (findfile newpath)
                    )
                  (if (vl-catch-all-error-p (vl-catch-all-apply 'vla-put-path (list x newpath)))
                    (princ (strcat "\n**OLD path found but was not changed!\n" xrpath))
                    (princ (strcat "\n" newpath))
                  )
                )
         )
       )
     )
   )
 )
 (princ)
); end of XrefPathChange


;.............................................................
;....          Xref Reload sub routine                 .......
;.............................................................
(defun XReload (/ cObj cName); Updated 2007-10-1: added error trap
 
 (defun *error*(msg)
   (setvar "modemacro" ".")
   (setvar "cmdecho" 1)
   (princ "\n...Reload xref terminated!!!  ")
   (princ)
   ); end of *error*

 (setvar "modemacro" "Reloading loaded xrefs......please wait......")
 (setvar "cmdecho" 0)
 (setq cObj(tblnext "BLOCK" T))
 (while cObj
   (setq cName(cdr(assoc 2 cObj)))
   (if
     (and
    (=(logand(cdr(assoc 70 cObj))32)32)
    (=(logand(cdr(assoc 70 cObj))4)4)
    ); end and
     (progn
      (vl-cmdf "_.xref" "_unload" cName)
      (vl-cmdf "_.xref" "_reload" cName)
      ); end progn
     ); wnd if
 (setq cObj(tblnext "BLOCK"))
 ); end while
 (setvar "modemacro" ".")
 (setvar "cmdecho" 1)
 (prompt "\n--- Xref change finished! ---")
 (princ)
 ); end of XReload

Link to comment
Share on other sites

Thanks JeepMaster, but nope, didn't work.

 

It would help matters if I had the path correct, should have been AG not GA.....!

 

But even changing those letters didn't help......so this is the latest (with corrected paths - copied and pasted from drawing properties):

 

EDIT: Someone (Jeff_M) kindly gave this a once over for me and realised that the Xref drawings were showing the

.dwg" extension! Whereas in the XR Manager, this is not the case.

 

Upon removing the .dwg extensions, AND putting the FULL drawing path WITH the extensions in, it worked!

 

The changes are shown in RED......!

 

Many Thanks Jeff for the pointer in the right direction and anyone else that may have helped me...and after 50 hours, i can finally put my feet up and enjoy the remainder of my weekend!

 

Edit 2: After a few tests, I have noticed it is making paths Absolute. Any way to update this lisp and make paths Relative?

 

Cheers All. :)

 

;...............................................................................
;
;      << Replace old xref files with a set of new xref files >>
;                    
;                           << Version 1.0 >>
;                     
;       NOTE: If new xrefs are in a different folder, you must call out
;             XrefPathChange.lsp from the code below.
;
;...............................................................................

(defun c:xrefnamechange (/ b bcol path)
 (vl-load-com)
 (setq bcol (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))))
 (foreach blk '(
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;>>>>>  Enter all xref names below in this format  >>>>>>
;>>>>>  ("OldXrefName" . "NewXrefName")            >>>>>>
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

[color="red"]    ("XREF ARR Site Plan" . "XREF GEN Site Plan")
   ("ARR Site Plan - 16042013" . "XREF GEN Site Plan")
   ("012-0500-AG-0004" . "STD-0100-AG-0004")
   ("012-0500-AG-0006" . "STD-0100-AG-0006")[/color]

;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
   )
   (if
     (and 
      (not (vl-catch-all-error-p (setq b (vl-catch-all-apply 'vla-item (list bcol (car blk))))))
      (= (vla-get-isxref b) :vlax-true)
     )
      (progn (vla-put-name b (cdr blk))
         (if (= (setq path (vl-filename-directory (vla-get-path b))) "")
       (vla-put-path b (strcat (cdr blk) ".dwg"))
       (vla-put-path b (strcat path "\\" (cdr blk) ".dwg"))
         )
       (vla-reload b)
      )
   )
 )
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;>>>                    XrefPathChange.lsp call out here.                       >>>>
;>>>           Enter all xref paths to be changed in this format.               >>>>
;>>>  (xrefpathchange "c:\\Oldfolder\\oldfolder" "c:\\newfolder\\newfolder")    >>>>
;>>>              Note: Remove code if new xref path is unchanged.              >>>>
;>>>                  Add ; infront of each line to block code.                 >>>>
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

[color="red"](xrefpathchange "C:\\Vault\\Designs\\012 - ARR\\0500 - PDS 1\\AG\\XREF DRG\\XREF ARR Site Plan.dwg" "C:\\Vault\\Designs\\STD - PROJECT\\0100 - CDP\\AG\\XREF DRG\\XREF GEN Site Plan.dwg")
(xrefpathchange "C:\\Vault\\Designs\\012 - ARR\\0500 - PDS 1\\AG\\XREF DRG\\ARR Site Plan - 16042013.dwg" "C:\\Vault\\Designs\\STD - PROJECT\\0100 - CDP\\AG\\XREF DRG\\XREF GEN Site Plan.dwg")
(xrefpathchange "C:\\Vault\\Designs\\012 - ARR\\0500 - PDS 1\\AG\\012-0500-AG-0004.dwg" "C:\\Vault\\Designs\\STD - PROJECT\\0100 - CDP\\AG\\STD-0100-AG-0004.dwg")
(xrefpathchange "C:\\Vault\\Designs\\012 - ARR\\0500 - PDS 1\\AG\\012-0500-AG-0006.dwg" "C:\\Vault\\Designs\\STD - PROJECT\\0100 - CDP\\AG\\STD-0100-AG-0006.dwg")[/color]

(XReload)
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
(princ)
);end of c:XrefNameChange



;...........................................................
;....        Xref Path Change sub routine by ronjonp    ......
;...........................................................
(defun xrefpathchange (path1 path2 / newpath xrpath)
 (vl-load-com)
 (vlax-map-collection
   (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))
   (function
     (lambda (x)
       (if (= (vla-get-isxref x) :vlax-true)
         (progn (setq xrpath (strcase (vlax-get x 'path) t)
                      path1  (strcase path1 t)
                      path2  (strcase path2 t)
                )
                (if (and (vl-string-search path1 xrpath)
                         (setq newpath (vl-string-subst path2 path1 xrpath))
                         (findfile newpath)
                    )
                  (if (vl-catch-all-error-p (vl-catch-all-apply 'vla-put-path (list x newpath)))
                    (princ (strcat "\n**OLD path found but was not changed!\n" xrpath))
                    (princ (strcat "\n" newpath))
                  )
                )
         )
       )
     )
   )
 )
 (princ)
); end of XrefPathChange


;.............................................................
;....          Xref Reload sub routine                 .......
;.............................................................
(defun XReload (/ cObj cName); Updated 2007-10-1: added error trap
 
 (defun *error*(msg)
   (setvar "modemacro" ".")
   (setvar "cmdecho" 1)
   (princ "\n...Reload xref terminated!!!  ")
   (princ)
   ); end of *error*

 (setvar "modemacro" "Reloading loaded xrefs......please wait......")
 (setvar "cmdecho" 0)
 (setq cObj(tblnext "BLOCK" T))
 (while cObj
   (setq cName(cdr(assoc 2 cObj)))
   (if
     (and
    (=(logand(cdr(assoc 70 cObj))32)32)
    (=(logand(cdr(assoc 70 cObj))4)4)
    ); end and
     (progn
      (vl-cmdf "_.xref" "_unload" cName)
      (vl-cmdf "_.xref" "_reload" cName)
      ); end progn
     ); wnd if
 (setq cObj(tblnext "BLOCK"))
 ); end while
 (setvar "modemacro" ".")
 (setvar "cmdecho" 1)
 (prompt "\n--- Xref change finished! ---")
 (princ)
 ); end of XReload

Edited by dpenney
Wrong Xref Name
Link to comment
Share on other sites

  • 2 years later...

Working well till recently hit a snag.

 

If the original path status is "NOT FOUND", it will not replace with the new path.

 

Please advise.

Link to comment
Share on other sites

I can't replicate your problem. Are you sure that your new file path is OK? If the file is not found it will not repath it.

Link to comment
Share on other sites

I can't replicate your problem. Are you sure that your new file path is OK? If the file is not found it will not repath it.

 

Yes, new path is fine cause can manually repath it using the Externally Reference box.

The problem is when the current/old xref drawing & folders is no longer there & when the main dwg is open, status indicated "NOT FOUND".

 

That is when i run the LISP, i get this error

 

Command: xrefr

 

Initializing...Automation Error. File access error

Command:

A photo for your reference

Untitled2.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...