Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

break a line with a gap at a point or intersection

24 REPLIES 24
SOLVED
Reply
Message 1 of 25
Anonymous
7791 Views, 24 Replies

break a line with a gap at a point or intersection

How do you break a line with a gap that opens equally in a + and - direction from a point or intersection?

Gap size needs to be a specific. 

24 REPLIES 24
Message 2 of 25
imadHabash
in reply to: Anonymous

Hi and Welcome to AutoDesk Forum,

 

i suggest to draw a circle by known diameter from the point that you select,then TRIM the distance that you don't need.

 

hhn.png

 

Note : it's also useful to know about BREAK command. >> Click <<

 

Regards,

Imad Habash

EESignature

Message 3 of 25
user181
in reply to: Anonymous

Attached is lisp routine to break line at specified size.  Use appload to load or drag and drop then command is GAP.  It asks for the distance of gap then the point to break and then the object to break.

EESignature


Message 4 of 25
Anonymous
in reply to: user181

Great LISP.  Find it very useful, especially the fact the distance is written into the routine so it prompts each time and lets you manually or click enter it similar to OFFSET command.  Found the old GAP lisp in the forums which this is probably originated from but someone had only suggested setting a default in the lisp file which isn't convenient as sometimes you need to change the distance often.

 

My only problem with this LISP is it may be changing my object snap settings when used (initially it was disabling my toggle mode for F3 to the menu opening until I turned off the check box in osnap settings menu so it goes back... but then it seems to often turn off my other snap settings?)  I know that maybe if its trying to temporarily setting intersect vs all other snaps when it gets to the pick mode and not setting them back then maybe there's a workaround with the text entry shortcuts (ie. when you type INT or END or TAN) while in a command to specify only osnap to those type of object snaps, but it keeps your overall settings intact after the command. 

 

If there is anyone more well versed in LISP could you look into the switch that may be used or whatever it might be that could causing this in the lisp?

 

If so, maybe there's a fix with the "INT" entry I described above, mid-command.

 

Or maybe I'm crazy and the lisp routine isn't causing it?  Didn't have issues before loading this lisp today though.  It's in my startup suite as well.

 

Thanks,

Warren

Message 5 of 25
Kent1Cooper
in reply to: Anonymous

There are a variety of other things out there that do this kind of thing, some considerably more sophisticated, for example BreakMultipleLines.lsp, here.  See the discussion in other Posts on that thread.  Some Searching will surely reveal others.

Kent Cooper, AIA
Message 6 of 25
Anonymous
in reply to: Kent1Cooper

Thanks Kent,

 

I'll check that one out.

Message 7 of 25
Anonymous
in reply to: Kent1Cooper

Kent,

 

I tried your Lisp and added it to my startup suite.  I do like having the multiple lines alternative which your lisp offers. 

 

For some reason though, it is opening up a blank drawing and initiating the command every time I start AutoCAD from scratch.

 

Hopefully there's a fix to the lisp for this?  I can't recommend it for everyone to use until it's got a bug like this out of it unfortunately.

 

Something in it where it initiates the command upon loading it.  I would prefer it to not initiate until you type MBR.

 

Also, noticed some bugging with my properties pallette showing up fairly blank when I wasn't even using the lisp.  Didn't notice it until I had your lisp loaded up so may have something to do with that.  If it happens again I'll try to post a screenshot.

 

Thanks,

Warren

Message 8 of 25
Kent1Cooper
in reply to: Anonymous


@Anonymous wrote:

Kent,

 

I tried your Lisp and added it to my startup suite.  ....  For some reason though, it is opening up a blank drawing and initiating the command every time I start AutoCAD from scratch.

.... 

Something in it where it initiates the command upon loading it.  I would prefer it to not initiate until you type MBR.

....


That "something in it" that initiates it is the last line in the file:

 

(C:MBR)

 

That runs it when you load it.  I don't ever do that in my own routines, but a lot of people do, I guess on the assumption that if you load it you want to run it, but obviously not thinking of putting it in the Startup Suite.  I was modifying someone else's routine there, and that part remained, but if you remove that line, it won't run it every time you start AutoCAD.

Kent Cooper, AIA
Message 9 of 25
Anonymous
in reply to: Kent1Cooper

That seemed to fix it.

 

Thanks again Kent!

Message 10 of 25
Anonymous
in reply to: user181


@user181 wrote:

Attached is lisp routine to break line at specified size.  Use appload to load or drag and drop then command is GAP.  It asks for the distance of gap then the point to break and then the object to break.


I've used this routine for a while and works wonderfully, but for some reason I've started having issues with it failing and giving a Unknown Command "NON". Any help is appreciated!

Message 11 of 25
Kent1Cooper
in reply to: Anonymous


@Anonymous wrote:

I've used this routine for a while and works wonderfully, but for some reason I've started having issues with it failing and giving a Unknown Command "NON". Any help is appreciated!


Could you be using it with "T" intersections?  Without trying it out, it looks like the routine needs the thing you're Breaking to extend to both sides  of the thing you're breaking it around, by at least as much as the half-gap size.  If it doesn't, one of those break points will return nil, and if it's the first one, that is, there is no point on the object to be Broken that's past the intersection by that much, I assume that will "break" the Break command, and the "non" controlling for the second break point will then come at the Command prompt as though a new command, rather than being inside the Break command it's expected to be a part of.

Kent Cooper, AIA
Message 12 of 25
user181
in reply to: Anonymous

Hi @Anonymous,  I did not write this routine but similar to what Kent said if half the break distance you enter is greater than the length of the line on either side of the break point you will get this error.  I have added an error function to it to restore the osnap settings if it is canceled after reading comments about the osnap settings changing.

 

 

EESignature


Message 13 of 25
Kent1Cooper
in reply to: user181


@user181 wrote:

....  I have added an error function to it to restore the osnap settings if it is canceled after reading comments about the osnap settings changing. 


A few comments....

 

That lists a localized variable that doesn't exist in the routine [PT2], and sets a variable that is never used [pr], and lists an argument in the *error* handler that is never referred to [msg].  Also, it doesn't let you know if there was a "real" error [not just a User cancellation], and regardless of whatever the error might be [even a User cancellation with ESCape before  OSMODE has been changed], it reports that it restored the OSMODE value.  The attached enhancement fixes all those things.

 

Also, if it encounters one of those no-such-point-on-the-object errors because an end is inside the gap-Break range, it won't Break it at all, whereas I would want it to Break it appropriately on the one side where it can.  The attached does that -- if a nominal Break point would be before the start  of the object, it uses the start point instead, and if it would be past the end, it uses the end point.

 

And it has some other features, such as that it won't accept zero or a negative number for the gap size, and on first use, it won't accept Enter but will insist on being given a value.

Kent Cooper, AIA
Message 14 of 25
user181
in reply to: Kent1Cooper

@Kent1Cooper,  As I said I didn't write this, it is something given to me. When I use it, it works. I can't comment on how the it is written. If it doesn't work as it does for me then nobody needs to use it.  I am sure something better is available somewhere. 

EESignature


Message 15 of 25
Anonymous
in reply to: user181

user181 & Kent,

Thanks for both your help; I'll try the final routine with the error checking and advise.  The addition of the code to return to the snaps set before the routine was run will be very helpful.  My error was apparently something to do with a rotated UCS; when I set it back to standard the old routine worked again.  A really rare thing that I rotate the UCS...

Thanks again!

 

Message 16 of 25

@Kent1Cooper

hi dear Kent Cooper, i saw your replies on a forum about break gap SLIP and thats why im messaging you. first i want to thank you for the SLIP you shared there that was very useful for me but i have a question and a problem of course.

for my work i need to create a 2mm gap on continues line. the number of lines that i have to create gap is so much ( i can say about 500 line on one sheet) and i cant use Linetype.
i use the break gap slip (attached to this message) for creating 2mm gap on lines but the proccess is so much and takes a lot of time.

(the proccess of the slip is to define the 2 mm gap then click on the line position and then click the line to make a single 2 mm gap.)

i want to know is there a slip or you can change this slip to work faster? like selecting all lines and define that lines with 70 mm length devide to three section with 2 mm gap between them and Lines longer than 70 mm devide to four section with 2 mm gap between the sections

this way the procces of that all 500 lines can be done with just a few Seconds

if you could help with that i'll be so appreciated.

Message 17 of 25


@matinmaleki222 wrote:

... is there a slip or you can change this slip to work faster? like selecting all lines and define that lines with 70 mm length devide to three section with 2 mm gap between them and Lines longer than 70 mm devide to four section with 2 mm gap between the sections....


[Get your auto-correcting program to accept "lisp" instead of correcting it to "slip."]

 

Are you talking about breaking Lines based only on their length, and with no consideration of any relationship to any intersecting object(s)?  That's a very different operation, but certainly can be done.

And would "lines with 70 mm length" be only those of exactly that length, or did you mean "70 mm or less"?  If so, is there some length below which it should switch to two sections with a gap, and some other length below which it should not be broken at all?

Kent Cooper, AIA
Message 18 of 25

In an easy explanation It's about making a continuous line to dashed line with 2 mm gap space.
But the important part is I can't and i shouldn't use line type or custom line type.

Just break a lot of number of lines to 2,3,4 or even more segment base on their length.
There is no intersection object or any relationship just making 2mm gap on simple multiple lines based on their length.

 

In the picture attached, there is a red line for example that i want that to be broke with 2mm gap. in a full DWG there is 500 or even more of this line. i want a way to select all red lines and make them broken with that gap.

Screenshot 2024-12-17 085901.jpg

 

For your next question:
70 mm length is just an example if i want to be more precise i want lines with 5 -50 mm length broke to 2 piece with 2mm gap
Lines with 50 -100 mm length broke to 3 segment with 2mm gap
Lines with 100-150 mm length broke to 4 segment (2mm gap)
Lines with 150-200 broke to 5 segment (2mm gap)
Lines with 200-300 broke to 7 segment (2mm gap)
Lines with 300-400 broke to 8 segment (2mm gap)
And more lengthen lines broke to 9,10,11segments

Message 19 of 25

It's unfortunate that your breakdown of lengths vs. number of segments is not a regular progression.  Some are 50mm ranges, some 100mm, there's no length range to divide into 6 segments, etc.

 

Would it be acceptable [it would certainly be far easier to encode] to have it break all selected Lines [and even other things like Circles/Arcs/Polylines/Ellipses/Splines, if you like] into however many segments it takes so that there are 2mm gaps between them and each segment is no longer than 50mm?  I have code that would provide a starting point for such a routine, in the DIV+ command in DivideMeasurePlus.lsp, >here<.  It will place Points or Blocks or marker Lines at whatever quantity is needed so that the spacing doesn't exceed a specified maximum distance.  It should be relatively easy to modify that to Break instead of drawing something.

Kent Cooper, AIA
Message 20 of 25

i tested the DivideMeasurePlus.lsp you sent the function of the DivideMeasurePlus.lsp is exactly what i want.
and i think if you modify that to Break (with 2mm gap) instead of drawing something is good but another important thing is that when i was testing the DIV+ command the problem was that i should to click on each line separately and for a lot of line number that will be a long process.
if you could modify that somehow to select all lines together that will be incredibly good.

i mean selecting all lines at once no matter of what length they are and the routine of DIV+ applies to all of them.

 

when i was testing that DivideMeasurePlus.lsp i defined 3 point segment on midpoint and it put 3 point on each line or if the line was short 2 points get placed on it, i mean the function of the DivideMeasurePlus.lsp is exactly what i want which that was amazing and if instead of point it put 2 mm gap that's the biggest help for me.

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

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report