PDA

View Full Version : Annoallvisible - 2nd Pair of Eyes Please?


ronsarlo
2009-04-15, 04:07 AM
Hey guys,

I seem to be having some problems with a section of lisp.
i thought I was getting half decent with lisp until this :Oops:

This part seems to work fine
(defun c:annoallvisibleoff (/ originaltab)
(setq originaltab (getvar "ctab"))
(foreach layouttab (layoutlist)
(setvar "ctab" layouttab)

This part seems broken
(setq timode(getvar "tilemode"))
(if(equal timode 0)(setvar "annoallvisible" 0))
(if(equal timode 1)(setvar "annoallvisible" 1))

This part seems to work fine too
);foreach
(setvar "ctab" originaltab)
(princ)
);defun
(c:annoallvisibleoff)

The if commands seem to behave erratically, sometimes setting annoallvisible works, sometimes it doesn't seem to do anything.

thanks for the help guys!

msretenovic
2009-04-15, 04:52 AM
Hey guys,

I seem to be having some problems with a section of lisp.
i thought I was getting half decent with lisp until this :Oops:

This part seems to work fine
(defun c:annoallvisibleoff (/ originaltab)
(setq originaltab (getvar "ctab"))
(foreach layouttab (layoutlist)
(setvar "ctab" layouttab)This part seems broken
(setq timode(getvar "tilemode"))
(if(equal timode 0)(setvar "annoallvisible" 0))
(if(equal timode 1)(setvar "annoallvisible" 1)) This part seems to work fine too
);foreach
(setvar "ctab" originaltab)
(princ)
);defun
(c:annoallvisibleoff)The if commands seem to behave erratically, sometimes setting annoallvisible works, sometimes it doesn't seem to do anything.

thanks for the help guys!
Give this a try:
(if (= (getvar "tilemode") 0)
(setvar "annoallvisible" 0)
(setvar "annoallvisible" 1)
)-OR-
(setvar "annoallvisible" (getvar "tilemode"))I suggest the second option because it appears you want the ANNOALLVISIBLE variable to be the same as the TILEMODE variable. :)