another way .............
;;; sub-routine
;;; create a text entity that uses the current layer,
;;; current textstyle and textsize. horiz. justification
;;; is "center" and vert. justification is "bottom"
;;;
;;; str = string
;;; pt = 3D point list, the insertion point
(defun make-txt (str pt / txt_ent)
(if
(setq txt_ent
(entmake
(list
'(0 . "TEXT")
(cons 10 pt)
(cons 8 (getvar "clayer"))
(cons 40 (getvar "textsize"))
(cons 1 str)
(cons 7 (getvar "textstyle"))
'(72 . 1); = horz. centered
(cons 11 pt)
'(73 . 1); = vert. bottom
)
)
)
txt_ent
)
)
;;; main function
;;;
;;; prints the xyz values of the selected point to the command
;;; line and places the "x,y" values in the dwg as a text entity
;;; at the user defined position
;;;
;;; if you want specific rounding of x & y values then change
;;; the lines '(rtos (..r pt) 2 <number of places>)' i.e.
;;; for 4 decimal places you would use (rtos (car pt) 2 4)
(defun c:tcoord (/ pt str1 str2 str_pt screen_txt)
(cond ((setq pt (getpoint "\nSelect Point: "))
(setq str1
(strcat
"\nNorthing = "
(rtos (cadr pt))
" Elevation = "
(rtos (caddr pt))
"\n"
)
str2
(strcat
"Easting = "
(rtos (car pt))
)
)
;; output to the command line
(princ str1); Northing = 1000.00 Elevation = 1000.00
(princ str2); Easting = 1000.00
(cond ((setq str_pt (getpoint pt "\nSelect Text Center Point: "))
(setq screen_txt
;; output = (x)1000.00,(y)1000.00
(strcat (rtos (car pt))","(rtos (cadr pt)))
)
(make-txt screen_txt str_pt))
))
(T (princ))
)
(princ)
)