(defun c:ctxt ( / _value data txt1 txtn )
(vl-load-com)
(setq data " ")
(defun _value (str / ATTr)
(while
(not
(if (and (setq ATTr (car (nentsel str)))
(member (vla-get-objectname (setq ATTr (vlax-ename->vla-object ATTr))) '("AcDbAttribute" "AcDbText")))
ATTr
(progn (princ str) nil)))) ATTr)
(if (setq txt1 (vla-get-textstring (_value "\nSelect First attribute/Text : ")))
(progn
(while
(setq txtn (vla-get-textstring (_value "\nSelect Next attribute/Text : ")))
(setq data (strcat data " + " txtn)))
(setq data (strcat txt1 data ))))
(setq ip (getpoint "\nPick Text insertion point"))
(entmakex (list (cons 0 "TEXT")
(cons 10 ip)
(cons 40 (getvar "textsize"))
(cons 1 data)))
)
(princ " Type CTXT to invoke the lisp")
I think I would do the routine like this: (quickly done)Working good but the routine alow to select one more text
(while (not ATTr)
(if (not (and (setq ATTr (car (nentsel str)))
(member
(vla-get-objectname
(setq ATTr (vlax-ename->vla-object ATTr))
)
'("AcDbAttribute" "AcDbText")
)
)
)
(setq ATTr nil)
)
)
Thnax CAB
Thanx LEE
Try something like this for your loop