Once you select an option this will continuously allow you to keep picking points until you hit Enter or Spacebar.
(defun c:enz (/ clr key pnt a b c)
;; Tharwat - 5.Jul.2019
;; (load "enz.lsp") enz
;; https://www.cadtutor.net/forum/topic/68126-require-lisp-3-in-1-for-xyz-coordinates-with-leader/?tab=comments#comment-552639
;; Add Commas
;; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/1-000-comma-separator/m-p/1857166#M230806
;; Code Source: John Uhden
;; This function pads a numeric string with commas.
;; Arguments:
;; num = any number, real or integer (>= 0)
;; # = precision, integer (>= 0)
;;
(defun rtoc (num # / p#)
(setq num (rtos num 2 #) # 1)
(while (and (/= (substr num # 1) ".")(<= # (strlen num)))
(setq # (1+ #))
)
(setq # (1- #) p# #)
(if (= (setq # (rem # 3)) 0)(setq # 3))
(while (< # p#)
(setq num (strcat (substr num 1 #) "," (substr num (1+ #)))
# (+ 4 #)
p# (1+ p#)
)
)
num
)
(setq clr (getvar 'clayer)) ; from dlanorh's code
(cond ( (null (tblsearch "LAYER" "Coor Text")) (command "-layer" "_M" "Coor Text" "_C" 7 "" "")) (t (setvar 'clayer "Coor Text")))
(and
(or (initget "NoZ All Z")
(setq key
(cond
((getkword
"\nPick your go [No Elevation , All Coordinates , Z coordinates only] [NoZ/All/Z] < NoZ > :"
)
)
("NoZ")
)
)
)
(setq pnt (getpoint "\nSpecify base point : "))
(setq dim (getvar 'DIMZIN))
(setvar 'DIMZIN 0)
(while pnt
(mapcar 'set
'(a b c)
(mapcar '(lambda (k p) (strcat k (rtoc p 4)))
'("E=" "N=" "Z=")
pnt
)
)
(setvar 'DIMZIN dim)
(command "_.LEADER"
"_none"
pnt
"\\"
""
(nth (vl-position key '("NoZ" "All" "Z"))
(list (strcat a "\\P" b) (strcat a "\\P" b "\\P" c) c)
)
""
)
(setq pnt (getpoint "\nSpecify base point : "))
) ; while
)
(setvar 'clayer clr)
(princ)
)