TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: JohnK on September 26, 2003, 11:15:36 AM

Title: REQ: Xref reload/open
Post by: JohnK on September 26, 2003, 11:15:36 AM
I was wondering if anyone had any code that would return the path of the selected xref? ...I tell ya what. Let me just tell you what i want and you tell me if you have the whole thing or just peices.
I want a tool for reloading an xref. If i select it, i want it to reload.
I also want a tool for returning th path of that xref.

Any code out there?
Title: REQ: Xref reload/open
Post by: daron on September 26, 2003, 11:24:01 AM
I might. Let me see. Yep. Here's an old one. Please forgive it's ugliness.
Code: [Select]
;;;reloads xrefs by selecting the xref.
(defun c:xre ()
     (setq cme (getvar "cmdecho"))
     (setvar "cmdecho" 0)
     (setq xref
      (car (entsel
"\nSelect referenced object to reload or <Enter>: "
   ) ;_ end of entsel
      ) ;_ end of car
     ) ;_ end of setq
     (if (= xref nil)
 (progn
      (command ".xref" "reload" "*")
      (princ "\nAll xref's have been reloaded.")
 ) ;_ end of progn
 (progn
      (setq xreload (cdr (assoc 2 (entget xref))))
      (command ".xref" "reload" xreload)
      (princ (strcat "\n" xreload " reloaded."))
 ) ;_ end of progn
     ) ;_ end of if
     (setvar "cmdecho" cme)
     (princ)
) ;_ end of defun


It doesn't tell you the path, but hey, you wanted something that was said and done.
Title: REQ: Xref reload/open
Post by: JohnK on September 26, 2003, 11:27:48 AM
Thank you sir.
Title: REQ: Xref reload/open
Post by: rugaroo on September 26, 2003, 03:26:33 PM
Daron -

Great program...One thing I noticed, is that when I tried reloading a small topo file, I was kicked out of LDD...It didn't really like that, but all well...not like I am changing my topo very often.

Rug