(defun C:XYZ (/ OSNAP PNT1 P1X P1Y P1Z P STDX STDY STDZ XCOORD
YCOORD ZCOORD PTXT )
(setvar "ORTHOMODE" 0)
; (setq OSNAP (getvar "OSMODE"))
; (command "setvar" "osmode" "1")
(command "setvar" "luprec" "0")
(prompt "NOTE!!! Coords. & leader drawn per current dimstyle; precision per UNITS... ")
(setq dst (getvar "dimstyle"))
(command "_.-DIMSTYLE" "_Restore" dst)
(setq PNT1 (getpoint "\nPick coordinate point: "))
(setq P1X (car pnt1))
(setq P1Y (cadr pnt1))
(setq P1Z (caddr pnt1))
(setq P (getvar "LUPREC"))
(setq STDX (rtos P1X 2 P))
(setq STDY (rtos P1Y 2 P))
(setq STDZ (rtos P1Z 2 P))
(setq XCOORD (strcat "X " STDX ))
(setq YCOORD (strcat "Y " STDY ))
(setq ZCOORD (strcat "Z " STDZ ))
(setq PTXT (getpoint "\nPick text location: "))
(command "LEADER" PNT1 PTXT "" XCOORD YCOORD ZCOORD "")
; (command "SETVAR" "osmode" OSNAP)
(command "setvar" "luprec" "4")
(princ)
)