Yea, exactly that. I updated the code at the previous post, but I guess it mustn't have been updated considering that your post above shows the earlier code before it was updated.
I simply modified the below snippet:
(setq datum (progn (initget 1) (getpoint "\nSpecify point for datum: "))
elev (progn (initget 1) (getreal "\nSpecify elevation at specified datum: "))
vtxlist (vl-remove-if-not '(lambda (x) (eq (car x) 10)) (entget (car es)))
hgts (mapcar '(lambda (x) (+ elev (- (caddr x) (cadr datum)))) vtxlist)
)
Simply using (initget 1) to make sure that the user does really input a number and doesn't press enter in order to have getreal return nil.
And of course prompting the user for the elevation height for calculation