Just for fun, a slight different way to set variables, I like the dotted pair listing to tie in variable name and its short description.
Could be expanded as basic lists with the last item being the 'get' function (string, int, distance....) for different types using read and eval [ (list "ard" "Approach Radius" "getDist") ]
(defun c:setvariables ( / acount ard crd erd aof eof )
(setq VariablesList (list
(cons "ard" "Approach Radius")
(cons "crd" "Center Radius")
(cons "erd" "End Radius")
(cons "aof" "Approach Offset")
(cons "eof" "Tie In Offet")
)) ; end list, end setq
(foreach n VariablesList
(setq MyX (getDist (strcat "\nSet " (cdr n) ": ")))
(eval (read (strcat "(setq " (car n) " " (vl-princ-to-string MyX) ")" )))
) ; end foreach
)
(defun c:setvariables ( / acount ard crd erd aof eof )
(setq VariablesList (list
(list "ard" "Approach Radius" "getdist")
(list "crd" "Center Radius" "getdist")
(list "erd" "End Radius" "getdist")
(list "aof" "Approach Offset" "getdist")
(list "eof" "Tie In Offet" "getdist")
)) ; end list, end setq
(foreach n VariablesList
(setq MyX ( (eval (read (last n))) (strcat "\nSet " (cadr n) ": ")))
(eval (read (strcat "(setq " (car n) " " (vl-princ-to-string MyX) ")" )))
(if (= (last n) "getstring") ; fix for strings
(eval (read (strcat "(setq " (car n) " \"" (vl-princ-to-string MyX) "\")" )))
)
) ; end foreach
)
Couple of edits for typos