Jump to content

LISP Divide Modification


eric_monceaux

Recommended Posts

Hello Fellow CAD users!

 

I come to you today with a difficult task, in my opinion. I had someone help me create this LISP routine that divides a line into no greater than 48" segments and includes .375" spacers between each

 

I have the need for a new evolution for this LISP that I don't even know if possible. What I would like it to do now is allow the user to specify the 'piece' dimension and after dividing the segment up with the user supplied dimension, take the 'left overs' and divide them evenly on the ends of the segment (please refer to final_desired_output.dwg) while still following the >48" rule.

 

I hope I have been clear enough, and thank you all in advance for your help!

final_desired_output.dwg

current_out.dwg

STONESEG-AUTO-AAS.lsp

Link to comment
Share on other sites

just try changingthis bit 1st

 

(progn
    (if (> (setq #len (distance p1 p2)) 48.) ; 48" ~ 0.9144
   (if (= (fix (setq #seg (/ #len 48.))) #seg)

(progn
(setq segl (getreal "\nEnter seg length"))
    (if (> (setq #len (distance p1 p2)) segl) ; 
   (if (= (fix (setq #seg (/ #len segl))) #seg)

Link to comment
Share on other sites

Thank you so much BIGAL! I will check that out. And as always, thank you for your contribution to this website. Personally I think you, ReMark, and Lee-Mac are celebrities! You guys are so knowledgeable and helpful to all those seeking guidance!

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...