Trimming a Segment of a Polyline

William Forty
William Forty

Here's a little tip that might be obvious to some, if not most of you. But for anyone that doesn't know this, it can be useful to know.

When using the trim command, you tend to specify geometry to trim lines back to. Of course this is no different with polylines, and you can of course use polylines to trim other geometry back to. But you may not know that you can actually trim a polyline back to itself, even when it doesn't intersect itself. For example, you may have a polyline that looks like below:

polyline trim

Lets say you want to trim away the whole horizontal portion of the polyline. A lot of people would invoke the TRIM command, hit spacebar or enter to select trimming back to everything, and trim away the individual parts of the polyline (the coloured parts below):

polyline trim colour

Ok, I admit that this gets the job done. But on a more complex polyline, with more information in the drawing this will take longer. AutoCAD® has to compare the point you picked with all other objects in the drawing to detect places to trim back to. In severe cases where the drawing is very busy, you could be faced with a crash situation, as the computer calculates all the possible lines you might want to trim back to.

For this reason, I think it is best to always tell AutoCAD® exactly what you want to do. Doing so minimises the complexity of the task, thus minimising the chance of AutoCAD® crashing or hanging.

So in this case, what I would do is invoke the TRIM command, select the polyline, and then pick the horizontal section. This is the most clear instruction to AutoCAD®. AutoCAD® knows to ignore any geometry other than that selected, which makes it very easy to know what you want to achieve. AutoCAD® will trim back to the next found vertices of the polyline:

polyline trim trimmed

So there we go - not exactly the most revolutionary tip in the world, but it could save you some time and gives a clearer instruction to AutoCAD®, thereby reducing the calculation overhead and crash chance.

That's all for today.


P.S. As always, I'd like to remind any new readers to subscribe below - its just an email, whenever I've written a new article.


neil jones
2011-10-14 09:58:21

Great tip - didn't know you could do that.....!!!

Bikash Mandal
2011-10-14 11:35:03

Very Very Good update

2011-11-08 12:52:57

In that case you can also select horizontal segment with pressed Ctrl and simply erase or delete it.

2011-11-08 13:58:16

That's quite right Lukasz, you can also select a sub-entity and delete that. Thanks!