CivilTechSource Posted 16 hours ago Share Posted 16 hours ago Hi Everyone, I have this piece of lisp that I have written and for some reason it prints twice the result following the if checks. Any ideas why? (if (< PipeClearance 0) (progn (command "color" "10") (command "circle" intpt 0.5) (princ "\nYou messed up! Pipe Clash! Pipe Clash!") ) (if (and (> PipeClearance 0) (< PipeClearance Clearance)) (progn (command "color" "50") (command "circle" intpt 0.5) (princ "\nOhhhh Pipes Very Close") ) (progn (command "color" "80") (command "circle" intpt 0.5) (princ "\nAll Pipes are Clear") ) ) ;---- ) Quote Link to comment Share on other sites More sharing options...
Saxlle Posted 14 hours ago Share Posted 14 hours ago (edited) Hi @CivilTechSource, You need to add a (princ) (choose one of these): - the first one you can add (princ) inside of each "progn" after (princ "\nOhhhh.....) and (princ "\nAll.....) - the second one you can add (princ) after "if" statement, before or after ";----" in your code. Adding a (princ) you will get a "clean" output in command line. Edited 14 hours ago by Saxlle 1 Quote Link to comment Share on other sites More sharing options...
CivilTechSource Posted 14 hours ago Author Share Posted 14 hours ago @Saxlle Worked like a charm! Thank you!!! Quote Link to comment Share on other sites More sharing options...
Saxlle Posted 14 hours ago Share Posted 14 hours ago You're welcome . Quote Link to comment Share on other sites More sharing options...
BIGAL Posted 3 hours ago Share Posted 3 hours ago @CivilTechSource you dont need to start a new topic this request can be added to your other post. Admin please merge into other post. Just a comment as your using multi if's it is probably better to start coding using a COND. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.