Author Topic: Check names  (Read 4077 times)

0 Members and 1 Guest are viewing this topic.

rude dog

  • Guest
Check names
« 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?

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Check names
« Reply #1 on: September 20, 2004, 06:52:29 AM »
Use 'eq' to test if entities are the same.

Code: [Select]

(setq e1 (car (entsel)))
<Entity name: 7ef61e10>
(setq e2 (car (entsel)))
<Entity name: 7ef61e10>
(eq e1 e2)
T
TheSwamp.org  (serving the CAD community since 2003)

rude dog

  • Guest
Check names
« Reply #2 on: September 20, 2004, 06:55:44 AM »
wow...duh...I need sleep..thanks

SMadsen

  • Guest
Check names
« Reply #3 on: September 20, 2004, 07:52:01 AM »
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.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Check names
« Reply #4 on: September 20, 2004, 10:53:10 AM »
Yes, don't use =

Code: [Select]
(setq e1 (car (entsel)))
<Entity name: 7ef61e10>
(setq e2 (car (entsel)))
<Entity name: 7ef61e10>
(eq e1 e2)
T
(= e1 e2)
nil
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Check names
« Reply #5 on: September 20, 2004, 10:56:23 AM »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

rude dog

  • Guest
Check names
« Reply #6 on: September 20, 2004, 09:32:56 PM »
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)

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Check names
« Reply #7 on: September 20, 2004, 11:56:52 PM »
Actually you have:
[=]
[eq]
[equal]

All have distinct differences
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Check names
« Reply #8 on: September 21, 2004, 12:11:14 AM »
Quote from: Keith
All have distinct differences

In other words, they are not equal.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Check names
« Reply #9 on: September 21, 2004, 12:16:33 AM »
Not Equal in some other programming languages...

!=
<>
ne
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

sinc

  • Guest
Check names
« Reply #10 on: September 21, 2004, 11:29:26 AM »
Not Equal = Sweet & Low?   :)

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Check names
« Reply #11 on: September 21, 2004, 11:43:17 AM »
Quote from: sinc
Not Equal = Sweet & Low?   :)

and sugar
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

rude dog

  • Guest
Check names
« Reply #12 on: September 25, 2004, 12:26:11 AM »
Cant forget bout Splenda