[Search tip detail and code files using keywords, tip number, author name, etc ]
 
Unload an Xref
Tip# 3262 By Billy Wooten On 13-Sep-2009
2
Rated By 1 users
Categories : DWG
Software type : AutoCAD 2010
Rename File To : No Files to download.
This LISP routine unloads an xref by picking on it.

Tip Patrol member Billy Wooten sent us a LISP routine he created that unloads an xref by picking on it.

"Although this routine will unload an xref, it won't detach it, so the xref is still referenced. If the object is a block or other object instead of an xref, the routine identifies it as such and instructs the user via the Command line to try again."

(defun c:ux (/ tData XName);Identify/Unload Xref
   (defun *error* (msg)
      (princ " ")
    )
   (while
      (setq tData (entget (car (entsel " Select Item to Test for Xref"))))
      (if
         (setq XName (cdr (assoc 2 tData)))
             (if (assoc 1 (tblsearch "BLOCK" XName))
                (progn
                   (command ".xref" "u" XName)
                   (prompt (strcat " Xref " XName " unloaded" ))
                )
                (princ " Block Selected - Try Again")
             );if
         (princ " Entity in Base Drawing - Try Again")
      );if
   );while
   (princ)
)

Notes from Cadalyst Tip Patrol: This routine is simple and quick, and it works well. Thanks, Billy!

Tested in AutoCAD 2010

 

 

 

Average Rating:
2


User comments