Two versions of the above, one using VL the other plain, take your pick. Point is inserted on the current layer.
(defun c:TEST1 (/ c_doc c_spc sel data z pt)
(vl-load-com)
(setq c_doc (vla-get-activedocument (vlax-get-acad-object))
c_spc (vlax-get-property c_doc (if (= 1 (getvar 'cvport)) 'paperspace 'modelspace))
)
(cond ( (and (setq sel (entsel "\nSelect Text : "))
(wcmatch (cdr (assoc 0 (setq data (entget (car sel))))) "*TEXT")
)
(setq z (distof (cdr (assoc 1 data))))
(cond ( (and z (setq pt (getpoint "\nSelect Point placement : ")))
(setq pt (reverse (cons z (cdr (reverse pt)))))
(vlax-invoke c_spc 'addpoint pt)
)
(t (alert "Selected text is not a number."))
)
)
(t (alert "\nSelected object is not a text or mtext."))
)
(princ)
)
(defun c:TEST2 (/ sel data z pt)
(cond ( (and (setq sel (entsel "\nSelect Text : "))
(wcmatch (cdr (assoc 0 (setq data (entget (car sel))))) "*TEXT")
)
(setq z (distof (cdr (assoc 1 data))))
(cond ( (and z (setq pt (getpoint "\nSelect Point placement : ")))
(setq pt (reverse (cons z (cdr (reverse pt)))))
(command "_.point" pt)
)
(t (alert "Selected text is not a number."))
)
)
(t (alert "\nSelected object is not a text or mtext."))
)
(princ)
)