We're trying to standardize grid and snap settings at my company, and so have implemented a LISP file into everyone's startup. This is currently working, but I'd like to improve it.
(defun c"test nil
(command "_.Grid" "_Major" "4"
"_.Grid" .25
"_.Grid" "_On"
"_.Snap" .0625
"_.Snap" "_On"))
I think it might be the cause behind some lag time between opening a file to when it's ready to edit. I know it's also the reason why every file now shows up as having been edited even if nothing technically changed.
I'd like to know if there's any way to check the file for the grid and snap settings before running the commands, so the file may not need to be changed or to do them more elegantly, so it isn't as resource intensive.
Solved! Go to Solution.
Solved by Anthony.Mauric. Go to Solution.
Solved by rhesusminus. Go to Solution.
Thank you for the suggestion @rhesusminus,
I'm having a little trouble with Gridunit and snapunit though, when testing with setvar in the command prompt it seems to be looking for a 2d coordinate. The following works;
and I'm not quite sure what the proper format to test and set this would be in the code
(if (not (= (getvar "GRIDUNIT") .25,.25))(setvar "GRIDUNIT" .25,.25))
I normally set these settings via the Drafting Settings in the drawing template, see attached. And it works
Thanks @Anonymous, but that's not going to work in this case.
In any case, I found what I was looking for. I needed to put my settings in a list. I'm not sure if I needed to also put them as variables, I was getting an error about an unexpected decimal point, but it worked.
(setq var1 0.25)
(if (not (= (getvar "GRIDUNIT") (list var1 var1)))(setvar "GRIDUNIT" (list var1 var1)))
Can't find what you're looking for? Ask the community or share your knowledge.