found this here, i modified it a bit.
(defun C:BTX (/ ELEM ETYK CM OS OLDERR PTW PT10 TMP ODL OPIS TBOX ITEM a ab ent ent1 temp1 comb)
(defun FILE:ERROR ()
(command "_undo" "_e")
(setq *ERROR* OLDERR)
(setvar "OSMODE" OS)
(setvar "CMDECHO" CM)
(princ)) ;end file:error
(defun XY (A) (list (car A) (cadr A))) ;end xy
(defun DXF (A B) (cdr (assoc A B))) ;end dxf
(defun STRIM (A)
(while (member (substr A 1 1) (list " " "," "." "-" ";"))
(setq A (substr A 2))
) ;_ end of while
A) ;end strim
(defun PRPT (A B)
(if (not (assoc A ELEM))
(setq ELEM (append ELEM (list (cons A B))))
) ;_ end of if
ELEM
) ;end prpt
(setq OLDERR *ERROR*
*ERROR* FILE:ERROR
ELEM NIL
CM (getvar "CMDECHO")
OS (getvar "OSMODE")
) ;_ end of setq
(setvar "CMDECHO" 0)
(setvar "OSMODE" 0)
(command "_undo" "_be")
(while (setq ETYK (entsel "\n* Pick a Text to Break *"))
(if (and (setq ELEM (entget (car ETYK))) (eq (DXF 0 ELEM) "TEXT"))
(progn
(setq PTW (XY (trans (cadr ETYK) 1 0)))
(command "_ucs" "_ob" (car ETYK))
(setq PTW (trans PTW 0 1)
OPIS (DXF 1 ELEM)
ITEM 1
TEMP 0.0
) ;_ end of setq
(while
(or
(not (member (substr OPIS ITEM 1) (list "" " ")))
(< TEMP (car PTW))
) ;_ end of or
(setq TBOX (textbox (subst (cons 1 (substr OPIS 1 ITEM)) (assoc 1 ELEM) ELEM)) ;_ end of textbox
TEMP (- (caadr TBOX) (caar TBOX))
ITEM (1+ ITEM)
) ;_ end of setq
) ;end while
(entmod (subst (cons 1 (substr OPIS 1 (1- ITEM))) (cons 1 OPIS) ELEM))
(setq A (append A (list '(62 . 4))))
(PRPT 62 256)
(PRPT 6 "BYLAYER")
(setq ab (subst (cons 1 (STRIM (substr OPIS (1+ ITEM)))) (cons 1 OPIS) ELEM)) ;_ end of entmake
;(command "_move" (entlast) "" "0,0" (list 0 (- (* 1.4 (DXF 40 ELEM))))) ;_ end of command
(setq ent (entsel "\nSelect prepending text line or to create new line: "))
(if ent
(progn
(setq ent (entget (car ent))
ent1 (cdr (assoc 1 ent))
temp1 (cdr (assoc 1 ab))
comb (strcat temp1 " " ent1))
(entmod (subst (cons 1 comb)(assoc 1 ent) ent))
)
(progn
(entmake
(subst (cons 1 (STRIM (substr OPIS (1+ ITEM)))) (cons 1 OPIS) ELEM)) ;_ end of entmake
(command "_move" (entlast) "" "0,0" (list 0 (- (* 1.7143 (DXF 40 ELEM))))) ;_ end of command
))
(command "_ucs" "_p")
(command "_undo" "_e")
(setq *ERROR* OLDERR)
(setvar "OSMODE" OS)
(setvar "CMDECHO" CM)
(princ)
) ;_ end of defun
)))