Break & Lengthen routine help.
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 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? 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.
页:
[1]