Author Topic: Reload Xrefs Lisp...  (Read 3221 times)

0 Members and 1 Guest are viewing this topic.

david

  • Guest
Reload Xrefs Lisp...
« on: October 09, 2006, 04:12:31 PM »
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

  • Seagull
  • Posts: 12417
  • Tell me a Joke!
Re: Reload Xrefs Lisp...
« Reply #1 on: October 09, 2006, 04:21:15 PM »
Huh....standard feature in DataCAD

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4076
Re: Reload Xrefs Lisp...
« Reply #2 on: October 09, 2006, 04:38:42 PM »
-xref;r;all;;
as a macro or
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

CADaver

  • Guest
Re: Reload Xrefs Lisp...
« Reply #3 on: October 09, 2006, 10:01:38 PM »
Code: [Select]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(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)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

david

  • Guest
Re: Reload Xrefs Lisp...
« Reply #4 on: October 10, 2006, 11:18:49 AM »
Thanks CADaver... works Great!

CADaver

  • Guest
Re: Reload Xrefs Lisp...
« Reply #5 on: October 10, 2006, 01:16:40 PM »
you're welcome