0 Members and 1 Guest are viewing this topic.
(defun c:TextChange (/ a b) (vl-load-com) (while T (setq a (car (nentsel "\nSelect text or mtext entity to change"))) (if (or a (setq b(entget a)) (= (cdr (assoc 0 b)) "TEXT") (= (cdr (assoc 2 b)) "MTEXT") ) ; end check (vla-put-TextString(vlax-ename->vla-object a) "%<\AcSm Sheet.Title>% ") (princ "\n Invalid Selection") ); end if ) ; end while (princ) ); end
I don't think macro's can change the value of a mtext entity. Code: [Select](defun c:TextChange (/ a b) (vl-load-com) (while T (setq a (car (nentsel "\nSelect text or mtext entity to change"))) (if (or a (setq b(entget a)) (= (cdr (assoc 0 b)) "TEXT") (= (cdr (assoc 2 b)) "MTEXT") ) ; end check (vla-put-TextString(vlax-ename->vla-object a) "%<\AcSm Sheet.Title>% ") (princ "\n Invalid Selection") ); end if ) ; end while (princ) ); end Quick and dirty.