Code Red > AutoLISP (Vanilla / Visual)

Reload Xrefs Lisp...

(1/2) > >>

david:
Does anyone have a lisp routine, they don't mind sharing, that will reload all the xrefs in a drawing without having to go through the xref manager and select each one.

Greg B:
Huh....standard feature in DataCAD

David Hall:
-xref;r;all;;
as a macro or

CADaver:

--- Code: ---;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun c:xre ()
(prompt "\N Select Element in XREF to RELOAD  ")
(xref-unload "reload")
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun c:xru ()
(prompt "\N Select Element in XREF to UNLOAD  ")
(xref-unload "unload")
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun c:xrd ()
(prompt "\N Select Element in XREF to DETACH  ")
(xref-unload "detach")
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun xref-unload ( xref-action / old setlgth co t2 temp blkname)
(command ".undo" "BEGIN")
   (setvar "cmdecho" 0)
      (setq
        old (ssget)
        setlgth (sslength old)
        co -1
        t2 "t"
      )
  (while (boundp 't2)
     (progn
       (setq
         co (1+ co)
         temp (entget (ssname old co))
         blkname (cdr (assoc 2 temp))
         t2 (ssname old (1+ co))
       )
         (command "-xref" xref-action blkname)
       )      ;; end progn
   )          ;; end while
(setq co (1+ co))
(princ)
(command ".undo" "END")
(princ)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

--- End code ---

david:
Thanks CADaver... works Great!

Navigation

[0] Message Index

[#] Next page

Go to full version