Not all my questions have been answered yet, but as a quick starting approach:
(defun C:TAML ; = Text At MultiLines
(/ ss txt n ends end1 end2 midpt ang)
(if (setq ss (ssget "_X" '((0 . "MLINE") (8 . "YourMlineLayer"))))
(progn
(setq txt (getstring "\nText content: "))
(repeat (setq n (sslength ss))
(setq
ends (vlax-get (vlax-ename->vla-object (ssname ss (setq n (1- n)))) 'Coordinates)
end1 (list (car ends) (cadr ends) (caddr ends))
end2 (cdddr ends)
midpt (mapcar '/ (mapcar '+ end1 end2) '(2 2 2))
ang (angle end1 end2)
)
(if (and (> ang (/ pi 2)) (<= ang (* pi 1.5))) (setq ang (+ ang pi))); plan-readable direction
(command "_.text" "_c" ; ["_cen" or "_center" taken as Osnap call]
(polar midpt (+ ang (/ pi 2)) (getvar 'textsize))
"" (cvunit ang "radian" "degree") txt
)
)
)
)
(princ)
)
It does the Text in the current Style, which it assumes is defined without a fixed height, and at the current Text Height, assuming that is an appropriate size, and on the current Layer. Differences from those can be built in, as answers are provided. Edit the Layer name to suit. How well it places Text [center-justified, off the definition-point path of the Mline by the Text height] depends on the style and scale and justification of the Mlines -- if those are always the same, something can be built in.
Kent Cooper, AIA