Just finished this prior to reading your post:
Enjoy,
Mike Weaver
AlasCAD
;;;adds text values with a space, doesn't erase anything
(defun c:adt ()
(adt T nil)
) ;_ end of defun
;;;adds text values without a space, erases subseqent entities
(defun c:adtx ()
(adt nil T)
) ;_ end of defun
(defun adt (
spacemode ;add intermediate space if non-nil
erasemode ;erase all but 1st item if non-nil
/
)
(if (and
(setq pent (nentsel "\nSelect primary entity: "))
(vlax-property-available-p
(setq pobj (vlax-ename->vla-object (car pent)))
'TEXTSTRING
) ;_ end of vlax-property-available-p
) ;_ end of and
(while (and
(setq ent (nentsel "\nSelect text to combine: "))
(vlax-property-available-p
(setq obj (vlax-ename->vla-object (car ent)))
'TEXTSTRING
) ;_ end of vlax-property-available-p
) ;_ end of and
(vla-put-textstring
pobj
(strcat
(vla-get-textstring pobj)
(if spacemode
" "
""
) ;_ end of if
(vla-get-textstring obj)
) ;_ end of strcat
) ;_ end of vla-put-textstring
(if erasemode
(vla-delete obj)
) ;_ end of if
) ;end while
) ;_ end of if
) ;end adt-new