;; Improved version of Autocad ID command
;; Created by Igal Averbuh 2017 (added alert option and cycle loop running)
;; Based on Edwin Prakoso Automatic coordinate labeling routine http://cad-notes.com

(defun c:id (/ p x y )
(setvar "cmdecho" 0)
(command "undefine" "id")
(while
(setq p (getpoint "\nPick Point: "))
(setq x (car p))
(setq y (cadr p))
(setq z (caddr p))

(princ (strcat
" X = " (rtos x)
" Y = " (rtos y)
" Z = " (rtos z)))

(alert (strcat "\nThis point have coordinate at"
"\n"
"\nCoordinate X = " (rtos x)
"\nCoordinate Y = " (rtos y)
"\nCoordinate Z = " (rtos z)))

)
(command "redefine" "id")
(setvar "cmdecho" 1)
)

Advertisements