(SysVarStore '("CMDECHO" "BLIPMODE" "MENUECHO" "CECOLOR" "CLAYER" "HIGHLIGHT" "LIMCHECK" "CMDDIA" "FILEDIA" "ATTDIA" "REGENMODE" "LUNITS" "LUPREC" ) ) ;_ end of SysVarStoreand each of the sysvars in the list has it's value captured. Then at the end of the function you would call SysVarReset to restore thier original values. It works by creating a global var of a list that contains each sysvar and it's current value.
;;;================================================================== ;;; (SysVarStore v) ;;; Store system variables ;;;------------------------------------------------------------------ ;;; Parameters: ;;; v list of var names to store ("CMDECHO" "CLAYER") ;;;------------------------------------------------------------------ ;;; Returns: ;;; sets global var Lobot:SVARS ;;;------------------------------------------------------------------ (defun SysVarStore (v) (setq Lobot:SVARS '()) (repeat (length v) (setq Lobot:SVARS (cons (list (car v) (getvar (car v))) Lobot:SVARS ) ;_ end of cons ) ;_ end of setq (setq v (cdr v)) ) ;_ end of repeat ) ;_ end of defun ;;;================================================================== ;;; (SysVarReset) ;;; Reset system vars changed by SysVarStore ;;;------------------------------------------------------------------ ;;; Parameters: ;;; uses global var Lobot:SVARS ;;;------------------------------------------------------------------ ;;; Returns: ;;; always returns nil ;;;------------------------------------------------------------------ (defun SysVarReset () (if Lobot:SVARS (progn (repeat (length Lobot:SVARS) (setvar (caar Lobot:SVARS) (cadar Lobot:SVARS)) (setq Lobot:SVARS (cdr Lobot:SVARS)) ) ;_ end of repeat (setq Lobot:SVARS nil) ) ;_ end of progn ) ;_ end of if ) ;_ end of defun