TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: vladimirzm on December 14, 2008, 03:19:07 PM

Title: crazy autocad calculator
Post by: vladimirzm on December 14, 2008, 03:19:07 PM
(setq p1 '(0.0 0.0 0.0) p2 '(5.0 5.0 5.0) n 1)

then

(c:cal "1*vec(p1,p2)") --> retunrs (5.0 5.0 5.0) that's ok
(c:cal "n*vec(p1,p2)") --> retunrs (450.0 450.0 450.0) !!!

what's wrong?
Title: Re: crazy autocad calculator
Post by: pkohut on December 14, 2008, 03:36:08 PM
Bug, works fine in '04, but not in '08.
Title: Re: crazy autocad calculator
Post by: vladimirzm on December 14, 2008, 03:59:17 PM
thnx pkohut but I have just learned:
the calculator uses by default values for this variables
n=north=90
e=east=0
s=south=270
w=west=180

i really didn't know that.  :? i thought it was a bug too
i have to use another variable.
Title: Re: crazy autocad calculator
Post by: highflyingbird on December 23, 2008, 09:38:32 AM
yes, it's real confuse.
I tried the letter from "A" to “z",just "e" "n" "s" "w" have default values.
Title: Re: crazy autocad calculator
Post by: Andrea on December 23, 2008, 09:54:02 AM
Code: [Select]
(c:cal (strcat (rtos n 2 8) "* vec (p1,p2)"))