AutoLISP: Attribute Visibility Toggle

Another simple but sweet routine. Sure this can be done through the command BATTMAN but this LISP routine saves clicks and picks… You simply select the blocks that contain attributes that you want to toggle on or off.

Here’s how:

  • AVT <enter> to start Attribute Visibility Toggle
  • Make a selection set of blocks that have attributes
  • <enter> when finished selecting


Seen Below is toggling the attributes off:

Seen below is toggling some attributes on:

;;; Attribute Visibility Toggle By Alan Thompson
;;; make a selection set of blocks with Atts and then hit <enter>
;;; This will toggle them either on or off
(defun c:AVT (/ ss i)
(if (setq ss (ssget "_:L" '((0 . "INSERT") (66 . 1))))
(repeat (setq i (sslength ss))
(foreach a (vlax-invoke (vlax-ename->vla-object (ssname ss (setq i (1- i)))) 'GetAttributes)
(vlax-put a 'Visible (~ (vlax-get a 'Visible)))

About AutoCAD Tips

This blog serves as a knowledge base for myself (and anyone else) so that I can reference tips & tricks that I have learned and also refer others to it as well. I hope that this blog helps you learn at least one tip to make your drafting/design experience better.
This entry was posted in Attributes, AutoLISP, AutoLISP: Attributes, Customization. Bookmark the permalink.

1 Response to AutoLISP: Attribute Visibility Toggle

  1. Great little lisp thanks for sharing as saved me so much time. Justin

Leave a Reply

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

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

Facebook photo

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

Connecting to %s