Author Topic: REQ: Xref reload/open  (Read 7852 times)

0 Members and 1 Guest are viewing this topic.

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
REQ: Xref reload/open
« 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?
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

daron

  • Guest
REQ: Xref reload/open
« Reply #1 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.

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
REQ: Xref reload/open
« Reply #2 on: September 26, 2003, 11:27:48 AM »
Thank you sir.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

rugaroo

  • Bull Frog
  • Posts: 378
  • The Other CAD Guy
REQ: Xref reload/open
« Reply #3 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
LDD06-09 | C3D 04-19 | Infraworks 360 | VS2012-VS2017