AutoCAD2000 winXP i am working on a dialog box that can be used to change the grid settings and the snap settings. i have the dcl file looking right. what i dont have is the lisp working. it starts to run like it wants to open the dialog but then it errors out. can someone offer any advice. attached is the dcl if needed. thanks in advance ;;SnapGrid dialog box ;;dcl file name is SnapGrid.dcl (defun C:snapgrid (/ dcl_id snapmode xsnap ysnap orgsnapunit gridmode gridsnap xgrid ygrid orggridunit) (setq dcl_id (load_dialog"snapgrid.dcl")) (new_dialog"snapgrid"dcl_id) ;;Get existing value of snapmode and snapunit ;;and write those values to the dialog box (set snapmode (getvar "snapmode")) (if (= 1 snapmode) (set_tile "snapon" "1") (set_tile "snapon" "0") ) (setq orgsnapunit (getvar "snapunit")) (setq xsnap (car orgsnapunit)) (setq ysnap (cadr orgsnapunit)) (set_tile "xsnap" (rtos xsnap)) (set_tile "ysnap" (rtos ysnap)) ;;Get the existing value of gridmode and gridunit ;;and write those values to the dialogbox (setq gridmode (getvar "gridmode")) (if(= 1 gridmode) (set_tile "gridon" "1") (set_tile "gridon" "0")) (setq orggridunit (getvar "gridunit")) (setq xgrid (car orggridunit)) (setq ygrid (cadr orggridunit)) (set_tile "xgrid" (rtos xgrid)) (set_tile "ygrid" (rtos ygrid)) ;;Read the values set in the dalog box and ;;then change the associated AutoCAD variables (defun setvars() (setq xsnap (atof (get_tile "xsnap"))) (setq ysnap (atof (get_tile "ysnap"))) (setvar "snapunit" (list xsnap ysnap)) (if (= "1" (get_tile "snapon")) (setvar "snapmode" 1) (setvar "snapmode" 0)) (setq xgrid (atof (get_tile "xgrid"))) (setq ygrid (atof (get_tile "ygrid"))) (setvar "gridunit" (list xgrid ygrid)) (if (="1" (get_tile "gridon")) (progn (setvar "gridmode" 0) (setvar "gridmode" 1)) (setvar "gridmode" 0) )) (action_tile "accept" "(setvars) (done_dialog)") (start_dialog) (princ) )