Jump to content

Recommended Posts

Posted

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

Posted

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?

Posted

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"?

Posted
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.

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...