Jump to content

How to do a Break Multiple ... read inside


g14c0m0

Recommended Posts

hi everyone

 

i'm looking at a lsp file which allows me break 2 intersecated lines leaving X millimeters from reference line.

 

i'm trying to explain better .... i'm going to say what i'm going to do right now to do that

 

i do an OFFSET of referenced line of 2mm (for example) up and down then i trim the line between the 2 i created with offset command.

 

i'm not use to talk in english, Italy here, but i hope you understand my request

 

take care

Link to comment
Share on other sites

Try this found some time

 

; Break a line with 2mm offset
; by BIG AL nov 2014
; add getreal ver 2 for offset distance
; ver3 check for break always inside as direction of line may break to outside
; will fail if pline

; defun to work out start pt repeatedly
(defun xyst (obj )
 (list (cadr  (assoc 10 obj))
(caddr (assoc 10 obj))
 )
)

; defun to work out end pt repeatedly
(defun xyend (obj )
 (list (cadr  (assoc 11 obj))
(caddr (assoc 11 obj))
 )
)
(defun C:break2mm ( / obj1 obj2 obj3 st1 st2 st3 end1 end2 end3 pt3 pt4)
(setq obj1 (entget (Car (entsel "\npick 1st line"))))
(setq obj2 (entget (car (entsel "\npick 2nd line"))))
(setq obj3 (entget (car (entsel "\npick 3rd line"))))

(setq oldsnap (getvar "osmode"))
(setvar "osmode" 0)

(setq st1 (xyst obj1)
    end1 (xyend obj1))


(setq st2 (xyst obj2)
    end2 (xyend obj2))

(setq st3 (xyst obj3)
    end3 (xyend obj3))

(setq pt1 (inters st1 end1 st2 end2))
(setq pt2 (inters st1 end1 st3 end3))

(setq ang (angle st1 end1))

(setq pt3 (polar pt1 ang 2.0)) 
(setq pt4 (polar pt2 (+ pi ang) 2.0)) ; 2.0 is 2mm 

(command "Break" pt3 pt4)

(setvar "osmode" oldsnap)

) ; defun

Link to comment
Share on other sites

thanks for you quick answer .... just tried right now cause i use autocad at work only anyway it's not what i was meaning ( i was sure i not explained good :( )

 

i have to select a referenced line ( for example a pipe ) and trim ALL lines that intersect referenced line just to show they're 2 different kinds of pipes

 

i hope i explained better right now

Link to comment
Share on other sites

Welcome to CADTutor!

 

I moved your thread to the AutoLISP, Visual LISP & DCL forum, please try to post in the appropriate forum, it will help you receive more relevant and quicker responses.

 

Perhaps you should show a before and after image and a .dwg file to make the question clear.

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