How can I choose the lines, whose ends can be detected?

Hi everyone,

As you see the attched pic, I have polylines connected together with the “X” connection and “Y” connection. I want to delete the the lines between the “Y” connection, indicated by the arrows. I have the GH code to find the ends of the “Y” connection, but I don’t know hot to select the lines through GH.


deletelines.gh (12.6 KB)

Any idea and suggestion is so appreciated!

Hi,

Check this:

Cheers,
BVR

Hi ajarindia,

Thank you for your idea. However, it is still a kind of manual choosing, as you need to find the index of the line manually. I prefer GH to find the lines automatically, because there will be tons of this kind of lines and you can’t choose them by hand.

Best,

missing


deletelines_2020Aug21a.gh (16.1 KB)

This looks for curve segment endpoints that are duplicated three times (MIndex ‘N’ output equals 3).

2 Likes

deletelines_re.gh (16.7 KB)

3 Likes

Thank you so much, Joseph!
I am testing it for large number of lines.

Thank you so much Kim!
That’s really compatible to my previous code!

It will fail if the connecting polyline you want to remove has more than one segment…

Hi Joseph,

The test shows that your code is very good for large amount of lines, and even faster than Kim’s.
Thank you so much again for your kind help.

Best