AutoLISP: Select Attributes for Invisibility

Here is a simple lisp routine that lets you select the individual attribute to make it “invisible.”

Here’s how:

  • INVIS <enter> to start
  • Select the attributes that you would like to be invisible
  • <enter> when finished


(defun c:invis (/ ent obj)
  (vl-load-com)

  (while (setq ent (car (nentsel "\nSelect Attribute: ")))
    (if (eq "ATTRIB" (cdr (assoc 0 (entget ent))))
      (vlax-put (setq obj (vlax-ename->vla-object ent)) 'invisible -1)))

  (princ))
Advertisements

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, AutoLISP: Blocks, AutoLISP: Modify. 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