I am baffled.
When I copy and paste the following code in one drawing, everything gets defined correctly. When I do it to another drawing, I get "nil" retruned.
(cond
((= UnitScale 0.09375) (setq mview1 (list -3.0 1.0 0.0)) (setq mview2 (list -1.0 3.0 0.0)) (setq mview3 (list -2.0 0.85 0.0)))
((= UnitScale 2.5) (setq mview1 (list -75.0 25.0 0.0)) (setq mview2 (list -25.0 75.0 0.0)) (setq mview3 (list -50.0 20.0 0.0)))
)
Whiskey Tango Foxtrot
I hope someone is able to help.
Solved! Go to Solution.
Solved by kpennell. Go to Solution.
I have confirmed that the variable is being set correctly, but for some reason, in a mmparticular drawing, the list is being built.
You don't say how the variable is being set, or how you're verifying that it's correct. If it's the result of some kind of calculation, using some value that's perhaps also the result of some calculation that may be based some number that could be ever-so-slightly different in the one problem drawing, it could be that the apparent 0.09375 is really something like 0.09375000000021 or 0.093749999983, in which case even though it may display correctly however you're checking, the (=) function would return nil. Try using (equal) with a fuzz factor instead, something like this:
(equal UnitScale 0.09375 1e-6)
The variables are not set previously by a calculation or anything. They are purposely set using (setq UnitScale 0.09375) directly.
I haven't had an issue with it for about ten years. Now some drawing is causing the issue.
Thanks for the response KC.
Oh for FS's.
When I set up the project, I set UnitScale to 0.9375 instead of 0.09375.
Sorry for your troubles KC.