Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

evaluate 3 variables in a condtional with and / or

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
m.deleurere
251 Views, 4 Replies

evaluate 3 variables in a condtional with and / or

Is it possible to evaluate three variables in a conditional statement using or / and? For example, take three variables x, y and z all with preset values so that x = 8, y = 9 and z = 0. Is it possible to write a statment that says evaluate x or y and z. Possible combinations would be x and z or y and z so that if x = 8 and z = 0, alert OK, OR if y = 9 and z = 0, alert OK. I have tried the following without success:

 (cond 
(((or (= x 8)(= y 9) (and (= z 0))) 
(alert "OK") 
); end statement 
); end cond

 

 

4 REPLIES 4
Message 2 of 5
hmsilva
in reply to: m.deleurere

(and (or (= x 😎 (= y 9))
(= z 0)
)

Henrique

EESignature

Message 3 of 5
m.deleurere
in reply to: hmsilva

that is perfect... thanks for your help

Message 4 of 5
hmsilva
in reply to: m.deleurere

You're welcome, Michael
Glad I could help

Henrique

EESignature

Message 5 of 5
stevor
in reply to: m.deleurere

And for actual coordinate values,

the '= function is oftern replaced by the 'equal.

For using HMSilva's methods,:

 (equal X 8 1e-4)

for  0.0001 th resolution, etc.

S

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost