OK, how about some overkill with the GETPOINT.
This will not return without a point whether picked or entered.
Entered points must be numbers separated with commas only, 2d or 3d OK.
;;;=======================[ getpoint_only.lsp ]=======================
;;; Author: Charles Alan Butler
;;; Version: 1.0 Jun. 16, 2005
;;; Purpose: Only get a point, do not return without one
;;; Sub_Routines: -None
;;; Arguments: -msg string containing the prompt message
;;; Usage: (getpoint_only msg)
;;; Returns: -the point picked
;;; Note: -User may enter a point at the command line 10,10 or 10,10,0
;;;====================================================================
(defun getpoint_only (msg / pt loop fuzz lastp)
(setq loop t
fuzz 0.0001
lastp (getvar "lastpoint")
)
(setq msg (strcat "\n" (cond (msg) ("Please select a point: "))))
;; in case the user pressed escape last time here
(if (< fuzz (distance '(1.9999 1.9999 0.0) (getvar "lastpoint")))
(setvar "lastpoint" '(1.9999 1.9999 0.0))
(setvar "lastpoint" '(1.8999 1.8999 0.0))
)
(while loop
;; pt must meet the following requirements
(if (and (setq pt (getpoint msg)) ; not nil
(listp pt) ; must be a list
;; do not allow bad numeric entry
(< fuzz (distance pt (getvar "lastpoint")))
)
(setq loop nil) ; ok to exit, else
(prompt "\nYou must select a point, please try again. ")
)
)
(setvar "lastpoint" lastp)
pt
)