;;; Reload all Loaded Xrefs and retain xref's colours
;;; Based on: http://www.cadtutor.net/forum/showthread.php?14319-Any-lisp-to-reload-only-quot-loaded-quot-xrefs

(defun c:ur(/ cObj cName)

(setvar "cmdecho" 0)

(setvar "visretain" 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
(princ)
); end of c:unreload
(setvar "visretain" 1)

(setvar "cmdecho" 1)
(c:ur)

Advertisements