Please someone explain an IF ELSE statement if LISP..
Please someone explain an IF ELSE statement if LISP..
(OP)
Hi,
Could someone please explain a typical IF ELSE statement in AutoLISP..
I've checked the help and it suggest the PROGN fucntion and i can't quite get my head round it, lol. Excuse me if i'm being hella-stupid..
Basically, i want to create a simple command line based routine that allows me to switch point styles. I want to just type something like PP, and it switches point style between the small dot (0 in PDMODE) and the crossed circle (35 in PDMODE)..
So if the point style is 35, then switch it to 1, and vice versa..
Could someone please explain a typical IF ELSE statement in AutoLISP..
I've checked the help and it suggest the PROGN fucntion and i can't quite get my head round it, lol. Excuse me if i'm being hella-stupid..
Basically, i want to create a simple command line based routine that allows me to switch point styles. I want to just type something like PP, and it switches point style between the small dot (0 in PDMODE) and the crossed circle (35 in PDMODE)..
So if the point style is 35, then switch it to 1, and vice versa..
Cheers,
Paul @ basepoint designz ltd..
basepointdesignzltd
www.bpdesignz.com
RE: Please someone explain an IF ELSE statement if LISP..
Basic If statement
CODE
(single statement that will be evaluated if above is TRUE)
(single statement that will be evaluated if above is FALSE)
);end of IF
The statements evaluated by the IF statment are single statemnts only. If you require more complex locig to be evaluated you need to have it look like...
CODE
(PROGN
(statements that)
(will be evaluated)
(if above is TRUE)
)
(PROGN
(statements that will)
(be evaluated if above is FALSE)
)
);end of IF
The PROGN function is used to make the LISP compiler behave as if everything with in the (PROGN .....) is a single statement.
I hope this is clear.
Kevin Petursson
RE: Please someone explain an IF ELSE statement if LISP..
Thanks Kevin
Cheers,
Paul @ basepoint designz ltd..
basepointdesignzltd
www.bpdesignz.com