Not exactly what you asked for but closest thing I have. This will copy from an attribute to existing single line text or vice versa or text to text or att to att - doesn.'t care but both have to be existing. You could tweak it to create the new line of text though pretty easily.
Code:
;Command Name Is TXTCOPY
(defun c:txtcopy ( / PRM1 PRM2 TCF TCT TMP)
(alpha)
(setq TMP '("TEXT" "ATTRIB")
PRM1 "\nSelect text to copy from: "
PRM2 "\nINVALID: Entity selected must be an attribute or single line text!"
)
(while t
(while (not (member (ecinf (setq TCF (car (nentsel PRM1))) 0) TMP))
(prompt PRM2)
)
(while (not (member (ecinf (setq TCT (car (nentsel PRM1))) 0) TMP))
(prompt PRM2)
)
(modent TCT 1 (ecinf TCF 1))
(if (= (ecinf TCT 0) "ATTRIB") (attupd TCT))
)
(omega))
;This is a set of standard routines I use A LOT.
;ALPHA sets a couple of variables and sets the error to run OMEGA if the command is canceled.
(defun ALPHA ()
(defun *error* (MSG)
(if (/= MSG "Function cancelled")
(princ (strcat "\nerror: " MSG))
)
(omega)
)
(sv '("cmdecho" "attdia") 0 t)
)
;ECINF just gets the entity code info needed
(defun ECINF (EN EC)
(if (= (type EN) 'ENAME)
(cdr (assoc EC (entget EN)))
(cdr (assoc EC EN))
) )
'MODENT modifys the entity code
(defun MODENT (EN EC EV)
(entmod (subst (cons EC EV) (assoc EC (entget EN)) (entget EN)))
)
;SV is a standard routine that saves the current setting of variables to a list for resetting with OMEGA and sets them per ALPHA
(defun SV (VN V? AL / CV)
(while VN
(if (and (not (member (setq CV (car VN)) VL)) (= AL t))
(setq VL (append VL (list CV (getvar CV))))
)
(setvar CV V?)
(setq VN (cdr VN))
) )
;OMEGA resets all the variables set by SV
(defun OMEGA ()
(while VL (setvar (car VL) (cadr VL)) (setq VL (cddr VL)))
(setq CMMAND nil)
)
(princ))
Rick France
Solutions Engineer
Hagerman & Company