TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Hangman on September 28, 2010, 05:54:46 PM
-
Afternoon everyone,
I'm having a brain cramp and can't seem to get a simple return, so I'm coming to you guys.
I have the following:
(setq var-a '(1.1 2.2 3.3))
Command: !a
(0.0 1.1 2.2)
Now if I want to check var-a, I THOUGHT I would type the following:
(if (= var-a '(1.1 2.2 3.3))(ALERT "Yahoo"))
What I get is nil
How do I verify the value of var-a ?
Thanks.
-
Maybe try ' equal ' or ' eq ' or maybe even throw in a fuzz factor with one of them.
-
Be careful with the various equality tests...
Command: (= '(1 2 3) '(1 2 3))
nil
Command: (eq '(1 2 3) '(1 2 3))
nil
Command: (equal '(1 2 3) '(1 2 3))
T
Similarly for enames:
Command: (setq e (car (entsel)))
Select object: <Entity name: 7ef03940>
Command: (setq f (car (entsel)))
Select object: <Entity name: 7ef03940>
Command: (= e f)
nil
Command: (eq e f)
T
Command: (equal e f)
T
-
Ohh, ...
EQ & EQUAL
And Equal has the Fuzz factor, thanks Tim.
Thank you guys. Sorry for the stupidity I'm portraying today.