Jump to content

Trim both ends of previously created line by selecting two lines.


wimal

Recommended Posts

(command "line"p1 p2 "")
 (setq[color="red"] line1[/color] (entlast))
(setq ss1 (car (entsel "\nSelect first cutting line:"))) 
(setq ss2 (car (entsel "\nSelect second cutting line:")))
(command "trim" ss1 ss2""":N " [color="red"]line1[/color] ""  )

 

Please can somebody correct my code.

The line 1 is generated by lisp command.

Manually selecting cutting lines I need trim the outer parts of line1

and keep the middle part.

Link to comment
Share on other sites

The use of the TRIM command in AutoLISP can be very temperamental as it is dependent on the position at which the object is selected, and can also be affected by the current zoom.

 

Since you are only working with lines, it would be far easier & more reliable to calculate the points of intersection using the inters function, and then modify the endpoints of the line you wish to trim.

 

Lee

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