Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Help with lisp to Automatically break multiple lines/poly lines

8 REPLIES 8
Reply
Message 1 of 9
brettgr
885 Views, 8 Replies

Help with lisp to Automatically break multiple lines/poly lines

I am looking for some help on making a lisp to break multiple intersecting lines that I select vertically and if it is posible if the breaks overlap to break the line horizontaly instead. Hopefully somone has a solution. 

8 REPLIES 8
Message 2 of 9
Kent1Cooper
in reply to: brettgr

Maybe this routine or this other one will do what you want, or at least give you a start.

Kent Cooper, AIA
Message 3 of 9
brettgr
in reply to: Kent1Cooper

That works but only problem is I need to break the line but I also need to have a 1/16" gap where the lines cross. 

Message 4 of 9
Kent1Cooper
in reply to: brettgr


@brettgr wrote:

That works but only problem is I need to break the line but I also need to have a 1/16" gap where the lines cross. 

You don't say which routine you mean by "that."  The one in the first link is supposed to have the option of a gap, at least, that's the way it's described on that page.  [But I haven't downloaded and tried it -- I just knew it was there from having seen that page before.]  You might also find several such routines if you Search these Forums.

Kent Cooper, AIA
Message 5 of 9
brettgr
in reply to: Kent1Cooper

Missed the first link and did the second link. I found the first link does work but the problem with it is you have to select the lines in a certain order to get it to break the line correctly. If there was a way to have it break vertically with 1/16" gap and if the gap couldn't be made then it would break it horizontally. Do you know if that could be possilbe?

 

Message 6 of 9
Kent1Cooper
in reply to: brettgr


@brettgr wrote:

Missed the first link and did the second link. I found the first link does work but the problem with it is you have to select the lines in a certain order to get it to break the line correctly. If there was a way to have it break vertically with 1/16" gap and if the gap couldn't be made then it would break it horizontally. Do you know if that could be possilbe?

 


It seems perfectly logical to select the Lines to break others around separately from the Lines to be broken, which pretty much requires selecting them "in a certain order."  If you don't want to do that, do you mean to Break all Lines at all intersections instead, including breaking both Lines at every intersection?  [It looks like that's an option in the routine in the second link -- maybe the gap aspect could be added to it.]

 

If you don't want to break both at each intersection, then you're going to need some way of designating which is to be broken and which not.  Or do you want to [for example] select only the Lines to be broken, and have them broken around every other Line they intersect with?  Or conversely, to select only the Lines to remain unbroken, and have it break all other Lines that intersect them?  If Polylines are in the mix, and one intersects a Line or another Polyline more than once, I assume you want something broken at each of those intersections.  What do you mean by "if the gap couldn't be made"?  Would that be only for horizontal Lines, because there's no "vertically" with them?  What about diagonal Lines, or would you use it only with orthogonal Lines?

 

I think an image or sample drawing would be helpful.  Also, put something like 'break all lines' into the Forums' Search window, and you'll get quite a few threads to check out -- something may already do what you want.

 

[By the way, I tried that routine, and I find that the way it handles the gap setting means you must use integer or decimal numbers -- you can't use fractions or feet-and-inches.  For example, an entered gap size of either 1/8 or 1'4 will result in a gap size of 1.  It should use (getdist) instead of (getstring) to ask for the gap, and various subsequent elements should be adjusted accordingly.]

Kent Cooper, AIA
Message 7 of 9
brettgr
in reply to: Kent1Cooper

All lines will be horizontal and virtical nothing will be diagonal. What I mean by if it cant break the line is if the left over line from triming is less than 1/16" the line will break horizontally instead of veritcal. I have a drawing attached with examples. The only problem with MBREAK lisp is it only works on lines and since I use both lines and poly lines it wont work. I would need only one of the lines to break not both. See drawing for couple more notes and for example thanks.

 

Message 8 of 9
brettgr
in reply to: brettgr

Any one have any suggestions?

Message 9 of 9
Kent1Cooper
in reply to: brettgr


@brettgr wrote:

Any one have any suggestions?


Not yet....  It's a pretty challenging situation.  A routine would need to pair off every Polyline and Line in the User's selection with every other one, and look for the intersection(s) of each pairing.  After Breaking one of them at a given intersection, I think [but I can imagine maybe there's a way around this...] it would then need to take the new Polyline/Line resulting from the Break, and compare it all over again with every other Polyline and Line.  I suspect the determing whether to Break the horizontal one at a given intersection shouldn't be too hard, if in your left-side illustration the vertical one can be Broken around every other horizontal one, and at the intersections between those, the horizontal ones Broken.  To Break only the horizontal ones throughout that group would, I think, be a real challenge, because it would require comparing somehow the results of finding the intersection between the vertical one and a horizontal one that you might want to Break with the results of finding the intersection between the vertical one and possibly more than one different horizontal one(s).  There would need to be a heck of a lot of storing up of intersection locations in a way that retains information about which Polylines/Lines they lie on, and running vertical-distance calculations between them.  I'm still trying to wrap my head around the procedural aspects of all of that....

Kent Cooper, AIA

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost