AutoLISP: ATTWIPE Clear Selected Attribute Values

Here is one that lets you easily clear the selected attribute tag(s).

This is especially helpful for when you are editing titleblocks that have populated attributes or when you copy a block (symbol) that already has attribute values already populated.

Here’s how:

(After loading of coarse)

  • ATTWIPE [enter]
  • Select the individual attributes that you would like to clear…
  • hit [enter] when finished to end the routine

ATTWIPE1

 


;; ------------------------------------------------------------------------------
;; AttWipe - © 2005 by Chuck Chauvin
;; Posted at: http://www.theswamp.org/index.php?topic=4934.0;all
;; Clears (wipes) the value of a selected attribute
;; ------------------------------------------------------------------------------
(defun C:AttWipe (/ AttSel AttLoc)
  
  (defun *error* (msg)
    (princ "\nInvalid selection.")
    (princ)
  );_ end defun *error*

  (defun SelectIt (msg)
  (setq AttLoc (cadr (setq AttSel (entsel (strcat "\nPick " msg " to wipe: ")))))
    );_ end defun SelectIt

  (defun WipeIt (/)
    (command "-attedit" "y" "" "" "" AttLoc "" "v" "r" "" "n")
    );_ end defun WipeIt

  (setvar "cmdecho" 0)
  
  (SelectIt "attribute")
  (WipeIt)
  (while AttSel
    (SelectIt "next attribute")
    (if	(= (type AttSel) 'list)
      (WipeIt)
      (setq AttSel nil)
      ) ;_ end if
    ) ;_ end while
  (princ)
  );_ end defun AttWipe
;; ------------------------------------------------------------------------------
About these ads

About AutoCAD Tips

I work for a large engineering firm and perform various CAD Administration duties and. I enjoy teaching/tutoring people in AutoCAD and seeing them enjoy using the program as much as I do. I hope that you find this blog a useful tool.
This entry was posted in Attributes, AutoLISP, AutoLISP: Attributes, Blocks, Modifying. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s