Jump to content

make invisible attribute visible


chelsea1307

Recommended Posts

any way to view invisible block attribute?

I created a block and the attributes really don't need to be seen in autocad just there for dataextraction and keeping it all in one location i want to go back through and make sure i have information filled in in all the right invisible attributes without having to open each block and check the attributes, but i don't want them permanently visible (i know i can freeze them or put them on a non plot layer but it clutters up the space when there is 20+ attributes to a block)

Link to comment
Share on other sites

Give this a try:

;;; Attribute Visibility Toggle
;;; Required Subroutines: AT:Entsel AT:GetAttributes
;;; Alan J. Thompson, 11.17.09
(defun c:AVT (/ #Obj)
 (and
   (setq #OBj (AT:Entsel nil
                         "\nAttribute Visibility Toggle\nSelect Attributed Block: "
                         '("LV" (0 . "INSERT") (66 . 1))
                         nil
              ) ;_ AT:Entsel
   ) ;_ setq
   (foreach x (AT:GetAttributes #Obj)
     (vla-put-visible
       x
       (if (eq (vla-get-visible x) :vlax-true)
         :vlax-false
         :vlax-true
       ) ;_ if
     ) ;_ vla-put-visible
   ) ;_ foreach
 ) ;_ and
 (princ)
) ;_ defun

You'll need a couple subroutines from my subroutine thread:

http://www.cadtutor.net/forum/showpost.php?p=271359&postcount=5

http://www.cadtutor.net/forum/showpost.php?p=271389&postcount=26

Link to comment
Share on other sites

Or at the command line type ATTDISP, or change the system variable ATTMODE

 

HaHa, oh well. LoL

 

(defun c:AM () (setvar 'attmode (abs (1- (getvar 'attmode)))) (princ))

Link to comment
Share on other sites

  • 1 year later...
Hey Alan,

 

Can you please update the subroutine locations that are linked?

 

The links aint workin' (at least when I click on them)...

 

Thanks

~Greg

I don't think it was ever what he had wanted (I missed the mark), but here's a simple rewrite...

 

(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)))
     )
   )
 )
 (princ)
)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...