spiker7221 Posted April 30, 2013 Posted April 30, 2013 I want use the Break command to split a line into (2) two separate lines. How do I create a selection set of those (2) two lines. My end goal is to Lengthen the ends of those (2) two lines by 24". . . but towards the point where the Break command was picked (I.E. middle of the original line). I just need help creating the code to process the (2) two new lines. Here's what I have so far. It seems to work on the first line in the list, but crashing on the 2nd line. (defun C:test(/ ent ldist) (setq CNT 0) (setq ldist 24.0) (prompt "\nPick rafters to lengthen...") (setq ent (ssget)) (if (not (null ent)) (progn (setq LEN (sslength ent)) (repeat LEN (setq ent1 (ssname ent CNT)) (command "_.lengthen" "_de" ldist ent1) (setq CNT (1+ CNT)) );end repeat );end progn );end if );end defun Quote
alanjt Posted April 30, 2013 Posted April 30, 2013 1. Would you only be selecting lines? 2. Would the break point always be the midpoint? 3. From the original midpoint, you want to add 24" to the two newly created lines? Quote
spiker7221 Posted April 30, 2013 Author Posted April 30, 2013 Good morning Alanjt, Yes, always selecting lines. I know how to filter for only lines... (setq ent (ssget '((0 . "LINE")))) The Break point is a user selected point along the line. Yes, I want to Lengthen both lines towards the Break point selected. Is the Lengthen command making it too complicated? Should I just find the end points of each line and move it 24"? Quote
alanjt Posted April 30, 2013 Posted April 30, 2013 Good morning Alanjt,Yes, always selecting lines. I know how to filter for only lines... (setq ent (ssget '((0 . "LINE")))) The Break point is a user selected point along the line. Yes, I want to Lengthen both lines towards the Break point selected. Is the Lengthen command making it too complicated? Should I just find the end points of each line and move it 24"? Not at all. I just wanted to get a better understanding of what you were wanting. I ask about the midpoint because you don't give the user an option to select a point along the line. So should they be prompted or will it always be the midpoint? If the user is prompted for the break point, then you can only do this one line at a time, but if the breaking point is always the midpoint, then you can select as many lines as you like. Quote
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.