i wanna change attribute tag which i choice with my specific texts ;
for example , i have text A500 ,B750 ,C1000, D1250, E1500 and i wanna change attribute tags in every click as my specific texts until i found necessary text
is there a lisp somthing like that
Solved! Go to Solution.
Solved by Lee_Mac. Go to Solution.
@E.S.7.9 wrote:
i wanna change attribute tag which i choice with my specific texts ;
for example , i have text A500 ,B750 ,C1000, D1250, E1500 and i wanna change attribute tags in every click as my specific texts until i found necessary text
is there a lisp somthing like that
I dont get it E.S.7.9, is that TEXT entity to attribute? or select A500 then select tags to copy string value A500?
those texts are going to be in lisp memory and when i run to lisp command and click to attribute tag , it s going to write there first text "A500" for example if i want to write 3 th text "C1000" i ll click to tag 3 time and lisp will put there to my 3th place text..
of course if there is a possibility
i realised that manually change mean it is a big lost time because there are a lot of attribute blocks i have to change
Try the following:
(defun c:attval ( / e l n o p ) (setq l '("A500" "B750" "C1000" "D1250" "E1500") n 0 ) (while (progn (setvar 'errno 0) (setq e (car (nentsel "\nSelect text or attribute <Exit>: "))) (cond ( (= 7 (getvar 'errno)) (princ "\nMissed, try again.") ) ( (= 'ename (type e)) (setq o (vlax-ename->vla-object e)) (cond ( (not (wcmatch (vla-get-objectname o) "AcDbAttribute,AcDb*Text")) (princ "\nInvalid object selected.") ) ( (not (vlax-write-enabled-p o)) (princ "\nObject is on a locked layer.") ) ( (equal p o) (vla-put-textstring o (nth (setq n (rem (1+ n) (length l))) l)) t ) ( (setq p o n 0) (vla-put-textstring o (car l)) t ) ) ) ) ) ) (princ) ) (vl-load-com) (princ)