(setq ss (ssget))
(if ss
(progn
(setq p1 (getpoint "\nPick or enter first point : "))
(setq p2 (getpoint p1 "\nPick or enter second point - distance : "))
(if (> (car p1) (car p2))
(command "_.move" ss "" "_non" p1 "_non" (mapcar '+ p1 (list (distance p1 p2) 0.0 0.0)))
(command "_.move" ss "" "_non" p1 "_non" (mapcar '- p1 (list (distance p1 p2) 0.0 0.0)))
)
)
)
Yes, all variables that are setq-ed and not localized by defined function, after execution of function are stored in memory of ACAD and are called global variables... You can view them among other defined functions in a list that is called with :
(atoms-family 0)
or if you want to use a list with them only as strings as elements with :
(atoms-family 1)
If you want to view values of them, you can use :
(mapcar 'eval (atoms-family 0))
But with this you'll get complete list of variables/values stored in CAD memory; if you want only setq-ed ones you have to before you do setq on them store all list in some variable like *list*
(setq *list* (atoms-family 0))
then you do setq-es with starting function without localized variables you want to view, or just setq them...
then you view them by :
(vl-remove-if '(lambda (x) (member x *list*)) (atoms-family 0))
or view their values with :
(mapcar 'eval (vl-remove '*list* (vl-remove-if '(lambda (x) (member x *list*)) (atoms-family 0))))