Well, it *was* solved by using a series of Diesel (if) functions, rather than a Lisp (cond) function. This *does* update when you change the Units type within a drawing, or open a different drawing using a different type of Units, and does not require a function to be run in every drawing, or a reactor to respond to changes in Units, or the use of a USERS? System Variable, or anything else like that:
{code}
(defun S::STARTUP ()
(setvar "modemacro"
(strcat
"DF:$(getvar,useri1) "
"$(if,$(getvar,snapmode), Snap:)"
"$(if,$(getvar,snapmode),$(rtos,$(getvar,snapunit)) )"
"$(if,$(=,$(getvar,lunits),1), Scientific)"
"$(if,$(=,$(getvar,lunits),2), Decimal)"
"$(if,$(=,$(getvar,lunits),3), Engineering)"
"$(if,$(=,$(getvar,lunits),4), Architectural)"
"$(if,$(=,$(getvar,lunits),5), Fractional)"
)
)
)
{code}
That includes our other Status-line stuff about our Drawing Factor and Snap settings. For just the Units type, you can do this:
{code}
(defun S::STARTUP ()
(setvar "modemacro"
(strcat
"$(if,$(=,$(getvar,lunits),1),Scientific)"
"$(if,$(=,$(getvar,lunits),2),Decimal)"
"$(if,$(=,$(getvar,lunits),3),Engineering)"
"$(if,$(=,$(getvar,lunits),4),Architectural)"
"$(if,$(=,$(getvar,lunits),5),Fractional)"
)
)
)
{code}
--
Kent Cooper
Kent Cooper wrote...
****GRAIN OF SALT: I find it doesn't update the units type when I change it.... It doesn't even update it when opening another drawing in another type of units, but sticks with the type in the first drawing opened when AutoCAD is started. I assume that has something to do with the Lisp vs. Diesel language. ....
Kent Cooper, AIA