;===========================================================; ; ; ; Sysvarreport.LSP by Michael Bulatovich, Aug. 17, 2006 ; ; www.michaelbulatovich.com ; ; ; ; Checks a set of system variables for deviations ; ; from a preferred set of values, reports, then ; ; prompts for permission to assign the preferred ; ; values to them. ; ; ; ;===========================================================; (defun c:sysvarreport (/ baseline varreport check variable value xvalue reset check2 ) ;===========================================================; ; ; ; Add as many lines as you want to the list below ; ; to add to the variables you want checked, or change ; ; the value of any variable listed already. Just ; ; stick to the format (cons "name of variable" value). ; ; ; ;===========================================================; (setq baseline (list (cons "apbox" 1) (cons "aperture" 5) (cons "cursorsize" 100) (cons "dragmode" 2) (cons "elevation" 0) (cons "expert" 2) (cons "filletrad" 0) (cons "gridmode" 0) (cons "grips" 1) (cons "gripsize" 3) (cons "highlight" 1) (cons "ltscale" 35) (cons "lunits" 4) (cons "luprec" 8) (cons "osmode" 59) (cons "pickadd" 1) (cons "pickbox" 5) (cons "pickfirst" 1) (cons "plinewid" 0) (cons "psltscale" 0) (cons "snapang" 0) (cons "thickness" 0) (cons "ucsfollow" 0) (cons "ucsicon" 1) (cons "visretain" 1) );end list varreport (strcat) );end setq (foreach check baseline (progn (setq variable (car check) value (cdr check) xvalue (getvar variable) );end setq (if (not (eq value xvalue)) (setq varreport (strcat varreport (strcat "\n" variable " is set to " (rtos xvalue 2 0) " instead of " (rtos value 2 0) "\n " ) ) );endsetq (princ) );end if );end progn );end foreach (textscr) (if (> (strlen varreport) 0) (progn (princ varreport) (initget "Yes No") (setq reset (getkword "\n \nDo you want to normalize ALL these system variables? /N :" ) ) (if (eq reset "No") (princ) (foreach check2 baseline (setvar (car check2) (cdr check2)) );end foreach );end if );end progn (princ "\n \n All checked variables match expected values.\n \n" ) );end if (princ) );end defun