Deleting Stacked Polylines in Reverse Direction

Hey forum,

I’m almost positive there’s a simple solution to this, but I’ve been at this for a little longer than I would’ve liked to be and realized that I’m just going to need some help on this.

The group of nodes I’m trying to put together right now is meant to be able to delete polylines, or within Dynamo I guess it’s curves, that are stacked on top of another. They are facing different directions with their start and end points the same, just reversed relative to each other.

This is my current drawing, where the blue lines are the lines I’m working with and the white arrows designating direction the line is oriented.


The arrow head determines the end point of the line, while the base of the arrow is the start point.

As you can see twice in the middle of the image, there’s two lines stacked on top of each going in opposite directions. I would only like to delete one of them, so that I can proceed to join the remaining three lines together for both sides of the image.

Every solution I’ve tried to put together has only resulted in deleting both of the center lines or neither of them. I also don’t have much to show for nodes to work with, as I feel like I’m at square one with this troubleshooting sequence. There isn’t anything particularly special with these polylines, any given length will work as long as they are connected at the corners.

Any help would be much appreciated.

Hi @mkneadler,

Does it matter which curve is preserved and which is removed? If not, the BlockExtensions.Overkill node in the Civil 3D Toolkit would probably do the trick.

3 Likes

No it doesn’t matter, so yes this seems like it would work for what I’m looking for. Is there any way you could provide a short example on how this block works? I’m getting lost on how to plug it in to my code with the block input.

The block is whatever block the polylines reside in. Assuming it is model space, then the input would be Document.Current → ModelSpace.

Okay yes, that part makes sense to me, but if I wanted to join the three lines after using the overkill command, how would I go about inserting the overkill node at a specific point within the order of nodes in my program?

Originally in my program, I used the explode command to separate two polycurves that each had a portion of themselves overlapping each other. This resulted in the four lines I was describing in the original post. I would then need to use the overkill command to get rid of one of the stacked lines, in order to just have three lines. After running the overkill command, I’m planning on using the List.Deconstruct and Curve.Join commands to join those remaining three lines together into one polycurve that contains three curves. My question then is, how do I insert the overkill command at a certain point based on the fact that the overkill node has nothing to do with analyzing certain polylines/curves?
image

So are the overlapping polylines an output from Dynamo or are they are input to your graph? If they are an output, then it seems like some upfront legwork to ensure that overlapping lines don’t get created in the first place might be a better approach than creating them, exploding, deleting, and re-joining.

Perhaps sharing the graph would help?

Okay here it is, I made a few notes to hopefully help a viewer understand what’s happening and why the lines come out to be the way they are:
IntersectionAnalysisForum.dyn (101.0 KB)

Here’s a sample drawing to go along with it:
IntersectionAnalysisForum.dwg (1.1 MB)