Author Topic: How do I combine these  (Read 1597 times)

0 Members and 1 Guest are viewing this topic.

Biscuits

  • Swamp Rat
  • Posts: 502
How do I combine these
« on: July 02, 2015, 11:23:50 AM »
Hello everyone...hopin' to get a little help from my friends.
In the following code each of the first three lines of code work fine to acquire an attribute for modifying.
I need to comment out two of the three for the routine they reside in to work.
I'm constantly changing the  ":" to accommodate the situation.
Hope I'm making sense here.

The last line of code is my attempt to combine the first three into one. But, no go.

Any ideas?
Thanks in advance



Code: [Select]
(if (= (cdr (assoc 1 (entget ename))) "---")
:(if (= (cdr (assoc 1 (entget ename))) "MM/DD/YY")
:(if (= (cdr (assoc 1 (entget ename))) "XX/XX/XX")


(if (= (cdr (assoc 1 (entget ename))) "---" "MM/DD/YY" "XX/XX/XX")




Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: How do I combine these
« Reply #1 on: July 02, 2015, 11:43:47 AM »
or?
Code: [Select]
(if (or (= (cdr (assoc 1 (entget ename))) "---")
        (= (cdr (assoc 1 (entget ename))) "MM/DD/YY")
        (= (cdr (assoc 1 (entget ename))) "XX/XX/XX")
    )
;;; do stuff here
)
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

Biscuits

  • Swamp Rat
  • Posts: 502
Re: How do I combine these
« Reply #2 on: July 02, 2015, 11:53:24 AM »
OMG....I have vapor-lock on the brain these days!
Works perfectly!
Thank you, Keith..............drinks on me!

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: How do I combine these
« Reply #3 on: July 02, 2015, 12:38:00 PM »
And another :
Code: [Select]
(if (vl-position  (cdr (assoc 1 (entget ename))) '("---" "MM/DD/YY" "XX/XX/XX"))
;;; do stuff here
)
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.

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: How do I combine these
« Reply #4 on: July 02, 2015, 12:55:06 PM »
One more:
Code - Auto/Visual Lisp: [Select]
  1. (if (wcmatch (cdr (assoc 1 (entget ename))) "---,MM/DD/YY,XX/XX/XX"))
  2.     ;;; do stuff here
  3. )

Biscuits

  • Swamp Rat
  • Posts: 502
Re: How do I combine these
« Reply #5 on: July 02, 2015, 01:47:14 PM »
Thanks for the replies, gang!
Obviously more than one way to skin the kat!