Oak3s,
Try placing your code in a .zip, and attach. Maybe someone
here can fix it. I see a couple of (either bad post or missing characters). For example, end of first line missing a ")", and
(setgridmode (getvar "gridmode")) .. should begin with "(setq ", not (set.
Bob