drill pattern

drill pattern

jimtoner
Explorer Explorer
441 Views
2 Replies
Message 1 of 3

drill pattern

jimtoner
Explorer
Explorer

Is it possible to insert an IF THEN ELSE statement in a rectangular array? 

say I have a typical cabinet side, if the side is 17" or less it would require 3 screws but if it is greater than 17"  but less than 28" it would require 4 using my formula for spacing.  I'm new  to this so please be patient thanks in advance..

0 Likes
Accepted solutions (2)
442 Views
2 Replies
Replies (2)
Message 2 of 3

Kent1Cooper
Consultant
Consultant
Accepted solution

This is a job for (cond) rather than (if).  Read about how it works in the AutoLisp Reference.  You could have more size categories than below, but let's say if the length is more than 28" it should be 5 screws, and it would never be long enough to require more than that:

 

(setq NumberOfScrews

  (cond

    ((<= edgelength 17) 3)

    ((<= edgelength 28) 4)

    (5)

  )

)

Kent Cooper, AIA
Message 3 of 3

jimtoner
Explorer
Explorer
Accepted solution

Thank you, I look forward to learning this, your help is greatly appreciated.

0 Likes