I extract for you, the function dfn_enak_text from "pp_hatcharea_jsldc31.lsp" . You must extend the solution with the my.function .
(dfn_enamk_text hostpoint sizeh msgwap nil nil nil colorinteger "").
You must replace (command "text") with (dfn_enamk_text (getpoint) sizeh "msgwap" nil nil nil color "").
(defun dfn_enamk_text( g335 inal mesj alig rota laie culo stil / rr x y z h g el isla vela ldxf q y i z c1 c2 c3 c0 ck p h w rstr stas)
(setq;|a34240|;
rstr (read "STR")
stas "STANDARD"
c0 48
ck "*[0-9]*"
laie (if (= laie nil) (getvar "CLAYER") laie)
alig (if (= alig nil) "0MC" alig)
rota (if (= rota nil) 100.0 rota)
inal (if (= inal nil) (getvar "TEXTSIZE") inal)
culo (if (= culo nil) 256 culo)
stil (if (= stil nil) stas (if (and (= (type stil) rstr) (> stil "") (tblsearch "STYLE" stil)) stil stas))
isla (if (and (= (type laie) rstr) (> laie "") (tblsearch "LAYER" laie)) T nil)
laie (if (= nil isla) "0" laie)
rota (if (= (type rota) (read "REAL")) rota 0.0)
c1 (substr alig 1 1)
c2 (substr alig 2 1)
c3 (substr alig 3 1)
c1 (if (wcmatch c1 ck) (- (ascii c1) c0) 0)
c1 (if (> c1 1) 1 (if (< c1 0) 0 c1))) (setq;|a35026|;
c2 (if (wcmatch c2 ck) (- (ascii c2) c0) 0)
c2 (if (> c2 3) 3 (if (< c2 0) 0 c2))) (setq;|a35164|;
c3 (if (wcmatch c3 ck) (- (ascii c3) c0) 2)
laie (strcase laie)
x (car g335)
y (cadr g335)
z (caddr g335)
z (if (= z nil) 0.0 z)
stil (if (and (= (type stil) rstr) (> stil "")) stil stas)) (setq;|a35416|;
ldxf (list (cons 0 "TEXT") (cons 1 mesj) (cons 7 stil) (cons 8 laie) (cons 10 g335) (cons 40 inal) (cons 50 rota) (cons 62 culo) (cons 71 c1) (cons 72 c2) (cons 100 "AcDbText") (cons 73 c3) (cons 11 g335))) (setq;|a35744|;
q nil) (setq;|a35760|;
g (entmakex ldxf))
g)
Can you find rotation-angle bug?