Xref Edit Lisp

bruceclement

Usenet Archive
Joined
Aug 4, 2003
Messages
14
Reaction score
0
I've been using the following lisp routine to open a picked xref for editing. It prompts the user to pick the xref on the screen, then it opens the xref (as if the user had used the open command).

(defun c:xe (/ ent_list x-nam x-ref x-path x)
  (setvar "cmdecho" 0)
 (defun *error* (msg)
   (command "xref" "r" x-nam)
   (princ msg)
   (princ)
 )
  (setq ent_list (entget (car (entsel "\nXREF Edit\nOpens selected XREF for editing.\nSelect Xref to edit:"))))   (setq x-nam (cdr (assoc 2 ent_list)))   (setq x-ref (tblsearch "block" x-nam))   (setq x-path (cdr (assoc 1 x-ref)))   (command "xref" "u" x-nam)   (command "vbastmt" (strcat "AcadApplication.Documents.Open " (chr 34) x-path (chr 34)))   (setq x (getkword "\nPress <ENTER> to reload XREF:"))   (command "xref" "r" x-nam)   (princ)
)

The problem is that it doesn't work if there is no path or a relative path (..\xref\etc). Does anyone have a routine that will return the path that the xref is "found in," or otherwise provide a mechanism to open an xref that doesn't have a full hard path?

Thanks!

Bruce
 
Opening the drawing in its own window is far supirior, as demonstrated by the degree to which everyone using the lisp routine I described prefers it over refedit.
 
Luis, thanks, but I can't seem to open your attachment (I'm accessing this discussion group via my web browser, and clicking on the attachment brings me to a "no attachement" page). Could you please put the lisp in the message, or email it to me at . Thanks.
 

Latest threads

Back
Top