;|HIDEATTS.LSP - Created 11/18/02 by Paul Kirill c2002 Kirill Design & AutoCAD Consulting, Richmond, Virginia This routine is given freely and may be freely distributed with the condition that all KDCAD copyright and contact information be included. This routine may not be posted on any site other than WWW.KDCAD.COM without permission. If you any any questions or would like to contract for additional customization, please drop me a note at info@kdcad.com! ===================================================================== NOTES ===================================================================== **Special Thanks to John Uhden (cadlantic.com) and Joe Burke (acadx.com) for helping iron out the rough spots! As it stands this routine will hide all attributes in all blocks in Model Space. Here are some simple modifications: 1)To EXCLUDE certain blocks FIND "(setq BLOCK_SSET..." and after "(cons 0 "INSERT")" ADD (not (cons 2 "")). Add as many as you need. 2)If you would rather pick your blocks manually, FIND "(setq BLOCK_SSET..." and REMOVE "X" so it reads "(setq BLOCK_SSET (ssget (list..." You will be prompted to pick blocks and only blocks will be added to your selection set. |; (defun C:HIDEATTS (/ SHOW_HIDE TOGGLE_ID BLOCK_SSET C BSS_LEN BLK_LIST AQ ATT2FIX VLA_ATT2FIX ) (vla-StartUndoMark (vlax-get-property (vlax-get-acad-object) "ActiveDocument") ) (princ "\nHIDEATTS.LSP cKDCAD, 2002") (initget "S SHOW H HIDE") (setq SHOW_HIDE (getkword "\nHide or Show all attributes? /S: ")) (if (= SHOW_HIDE "S") (setq SHOW_HIDE 1 TOGGLE_ID "Showed" ) (setq SHOW_HIDE 0 TOGGLE_ID "Hid" ) ) (setq BLOCK_SSET (ssget "X" (list (cons 0 "INSERT") (cons 66 1) (cons 67 0)) ) ) (setq c -1) (setq BSS_LEN (rtos (sslength BLOCK_SSET) 2 0)) (setq AQ 0) (repeat (sslength BLOCK_SSET) (setq BLK_LIST (entget (ssname BLOCK_SSET (setq c (1+ c))))) (if BLK_LIST (progn (while (/= "SEQEND" (cdr (assoc 0 (setq BLK_LIST (entget (entnext (cdr (assoc -1 BLK_LIST)))) ) ) ) ) (setq AQ (1+ AQ)) (setq ATT2FIX (cdr (assoc -1 (entget (cdr (assoc -1 BLK_LIST))))) ) (setq VLA-ATT2FIX (vlax-ename->vla-object ATT2FIX)) (vlax-put-property VLA-ATT2FIX 'Visible SHOW_HIDE) (setq ATT2FIX (cdr (assoc -1 (entget (entnext (cdr (assoc -1 BLK_LIST)))) ) ) ) ) ) ) ) (princ (strcat TOGGLE_ID " " (rtos AQ 2 0) " attributes in " BSS_LEN " blocks..." ) ) (vla-EndUndoMark (vlax-get-property (vlax-get-acad-object) "ActiveDocument") ) (princ) )