g14c0m0 Posted November 28, 2014 Share Posted November 28, 2014 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 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted November 28, 2014 Share Posted November 28, 2014 A lisp pick line 1 then pick other 2 lines work out break pts. Will try to find time unless some one posts first. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted November 28, 2014 Share Posted November 28, 2014 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 Quote Link to comment Share on other sites More sharing options...
g14c0m0 Posted December 1, 2014 Author Share Posted December 1, 2014 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 Quote Link to comment Share on other sites More sharing options...
SLW210 Posted December 1, 2014 Share Posted December 1, 2014 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. Quote Link to comment Share on other sites More sharing options...
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.