RobyG Posted September 29, 2014 Share Posted September 29, 2014 How would I change a selected attribute from visible to invisible using visual lisp and then have another routine to make all attributes in a selected block visible? thanks roby Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 29, 2014 Share Posted September 29, 2014 Try the following two programs: (defun c:hideatt ( / ent ) (while (progn (setvar 'errno 0) (setq ent (car (nentsel "\nSelect attribute: "))) (cond ( (= 7 (getvar 'errno)) (princ "\nMissed, try again.") ) ( (/= "ATTRIB" (cdr (assoc 0 (entget ent)))) (princ "\nSelected object is not an attribute.") ) ( (vla-put-invisible (vlax-ename->vla-object ent) :vlax-true)) ) ) ) (princ) ) (defun c:showatts ( / ent ) (while (progn (setvar 'errno 0) (setq ent (car (entsel "\nSelect block: "))) (cond ( (= 7 (getvar 'errno)) (princ "\nMissed, try again.") ) ( (/= "INSERT" (cdr (assoc 0 (entget ent)))) (princ "\nSelected object is not a block.") ) ( (/= 1 (cdr (assoc 66 (entget ent)))) (princ "\nSelected block is not attributed.") ) ( (foreach att (vlax-invoke (vlax-ename->vla-object ent) 'getattributes) (vla-put-invisible att :vlax-false) ) ) ) ) ) (princ) ) (vl-load-com) (princ) Quote Link to comment Share on other sites More sharing options...
RobyG Posted September 30, 2014 Author Share Posted September 30, 2014 thanks Lee I will figure out how to make all attributes in the dwg visible again, when all in a block are invisible the block can't be selected, because the blocks are just attributes. thanks again roby Quote Link to comment Share on other sites More sharing options...
nod684 Posted September 30, 2014 Share Posted September 30, 2014 (edited) Try the following two programs: (defun c:hideatt ( / ent ) (while (progn (setvar 'errno 0) (setq ent (car (nentsel "\nSelect attribute: "))) (cond ( (= 7 (getvar 'errno)) (princ "\nMissed, try again.") ) ( (/= "ATTRIB" (cdr (assoc 0 (entget ent)))) (princ "\nSelected object is not an attribute.") ) ( (vla-put-invisible (vlax-ename->vla-object ent) :vlax-true)) ) ) ) (princ) ) (defun c:showatts ( / ent ) (while (progn (setvar 'errno 0) (setq ent (car (entsel "\nSelect block: "))) (cond ( (= 7 (getvar 'errno)) (princ "\nMissed, try again.") ) ( (/= "INSERT" (cdr (assoc 0 (entget ent)))) (princ "\nSelected object is not a block.") ) ( (/= 1 (cdr (assoc 66 (entget ent)))) (princ "\nSelected block is not attributed.") ) ( (foreach att (vlax-invoke (vlax-ename->vla-object ent) 'getattributes) (vla-put-invisible att :vlax-false) ) ) ) ) ) (princ) ) (vl-load-com) (princ) hi Lee thanks for this... commonly i do turn on QTEXT for me to select the invisible attributes use and turn it off back again. can this be modified a bit to continously TURN ON invisible attributes until i hit enter? Edited September 30, 2014 by nod684 Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted October 1, 2014 Share Posted October 1, 2014 Another option might be to set ATTDISP temporarily to ON to display all invisible attributes, without modification. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.