This will give you something to play with.
Look into the TEXTBOX function
(defun c:rm (/ A B BOX CNT DIS DT FT H HT HT1 IX IY MT P1 P2 P3 P4 PF PM PT
RM RSZ TM TXCLR TXLAY TXLAYER TXT X X1 XF Y Y1 YF)
(defun rn_help ()
(textpage)
(princ "\nROOMNAME OPTIONS: ")
(princ "\n\t Living Kitchen Bed Toilet ")
(princ "\n\t Office SHop STore STUdy ")
(princ "\n\t Dining Puja BAth W.c. = WC ")
(princ "\n\t LIft = LT LObby S.toi. Living/dining = LD ")
(princ "\n\nPress any key to return to your drawing ")
(grread)
(princ "\r ")
(graphscr)
) ;End of rn_help
;; layer Make or set current
(defun LayerMake(lyrname Color ltype Other)
(if (tblsearch "LAYER" lyrname)
(progn
(command "._Layer" "_Thaw" lyrname "_On" lyrname "_UnLock" lyrname "_Set" lyrname)
(if (or (null other) (= Other "")) (command "") (command Other lyrname ""))
)
(progn
(command "._Layer" "_Make" lyrname "_Color"
(if (or (null color)(= Color "")) "_White" Color) lyrname
"LT" (if (or (null ltype)(= ltype "")) "Continuous" ltype) lyrname)
(if (or (null other) (= Other "")) (command "") (command Other lyrname ""))
)
)
)
(defun MakeText (pt10 pt11 lay sty ht str / dxf72)
(if (< (distance pt10 pt11) 0.00001)
(setq dxf72 1)
(setq dxf72 5)
)
(entmakex (list (cons 0 "TEXT") ; ***
(cons 1 str) ; * (the string itself)
;; (cons 6 "BYLAYER") ; Linetype name
;(cons 7 sty) ; * Text style name, defaults to STANDARD, not current
(cons 8 lay) ; layer
(cons 10 pt10) ; * First alignment point (in OCS)
(cons 11 pt11) ; * Second alignment point (in OCS)
(cons 39 0.0) ; Thickness (optional; default = 0)
(cons 40 ht) ; * Text height
(cons 41 1.0) ; Relative X scale factor, Width Factor, defaults to 1.0
(cons 50 0.0) ; Text rotation ange
;; (cons 51 0.0) ; Oblique angle
;; (cons 62 256) ; color
;;(cons 71 0) ; Text generation flags
(cons 72 dxf72) ; Horizontal text justification type
;;(cons 73 0) ; Vertical text justification type
)))
(if (and (null txlay)(null (setq txlayer (tblsearch "layer" (setq txlay "tx")))))
(progn
(setq txlay (getstring "\nLayer name for TEXT : "))
(setq txclr (getstring (strcat "\nColor for " txlay " layer: ")))
(LayerMake txlay txclr nil nil)
)
(prompt "\nTEXT ON TX LAYER")
)
(setvar "osmode" 32)
;(menucmd "p0=filters")
;(menucmd "p0=*")
(or ht (setq ht "250"))
(setq p1 (getpoint "\nPick room corner: ")
p2 (getcorner p1 "\nPick Diagonally opposite corner: ")
p3 (list (car p2) (cadr p1))
p4 (list (car p1) (cadr p2))
a (distance p1 p3)
b (distance p1 p4)
x (* 0.001 a)
y (* 0.001 b)
x1 (rtos x 2 2)
y1 (rtos y 2 2)
mt (strcat x1 "x" y1)
)
(setq ix (cvunit x "meter" "inch")
iy (cvunit y "meter" "inch")
xf (rtos ix 4 0)
yf (rtos iy 4 0)
ft (strcat xf "x" yf)
)
(prompt "\nENTER FOLLOWING KEYWORD OR TY FOR TYPE")
(setq cnt t)
(while
(not (progn
(initget 1
(strcat "Living Kitchen Bed Toilet "
"Office SHop STore STUdy "
"Dining Puja BAth WC TY ? "
"LT LObby S.toi. LD "
)
)
(setq rm (getkword
"\nROOM NAME = Liv/Bed/Kit/Toi/Off/Din/SHop/BAth/WC/STore/STUdy/S./LT/LD/LO/TYpe/?:"
)
)
(cond
((= rm "?") (rn_help))
((= rm "LT") (setq rm "LIFT"))
((= rm "LD") (setq rm "living/dining"))
((= rm "WC") (setq rm "W.C."))
((= rm "TY") (setq rsz (strcase (getstring t "\nTYPE ROOM NAME: "))))
(t (setq rsz (strcase rm)))
)
)) ; not progn
) ; while
(setq tm (strcase (getstring (strcat "\nENTER TEXT HEIGHT <" ht ">:")) t))
(if (/= tm "")
(setq ht tm)
)
(setq h (atof ht)
ht1 (* h 0.9)
dt (* h 2.0)
)
(setvar "osmode" 0)
(setvar "orthomode" 1)
(setq ht1 (fix ht1))
(setq pt (polar p1 (angle p1 p2) (/ (distance p1 p2) 2))
pm (polar pt (* pi 1.5) (/ h 3.55))
pf (polar pt (* pi 1.5) dt)
)
(setq txt (MakeText pt pt txlay "rD" h rsz)) ; Center Bottom
(setq box (textbox (entget txt))
dis (/ (caadr box) 2.))
(MakeText (polar pm 0 dis) (polar pm pi dis) txlay "rs" ht1 mt)
(MakeText (polar pf pi dis) (polar pf 0 dis) txlay "rs" ht1 ft)
(princ)
)
<code updated with the TextBox function>