TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: rude dog on September 20, 2004, 06:24:21 AM
-
How could one run a test on two entities selected to see if they have the same entity name...in autolisp...any ideas?
-
Use 'eq' to test if entities are the same.
(setq e1 (car (entsel)))
<Entity name: 7ef61e10>
(setq e2 (car (entsel)))
<Entity name: 7ef61e10>
(eq e1 e2)
T
-
wow...duh...I need sleep..thanks
-
Rude dog, I wouldn't know if you need sleep but not necessarily for having asked this question. It's a very good question which can cause quite a few errors when one doesn't bother to ask it.
Equality doesn't always equate equality when it comes to programming.
-
Yes, don't use =
(setq e1 (car (entsel)))
<Entity name: 7ef61e10>
(setq e2 (car (entsel)))
<Entity name: 7ef61e10>
(eq e1 e2)
T
(= e1 e2)
nil
-
In fact take a look here.
http://theswamp.org/phpBB2/viewtopic.php?t=764&highlight=equal+entity
-
Hey bro's....You know just to be honest :oops: :oops:
I did think that <=> and <eq> where the same..glad I asked
I guess I need to read.... more than I need the sleep...
Thanks 8)
-
Actually you have:
[=]
[eq]
[equal]
All have distinct differences
-
All have distinct differences
In other words, they are not equal.
-
Not Equal in some other programming languages...
!=
<>
ne
-
Not Equal = Sweet & Low? :)
-
Not Equal = Sweet & Low? :)
and sugar
-
Cant forget bout Splenda