SHATTER - group of points and curves

Hi All,

I have a quick question but keep bothering me for a long time.
As the image shown below, after Shatter Ii’m trying to select only the middle sets of the segments by using “List Item > Index”. However in some occasions when the curves not divide exactly into 3 groups then the selection could fail.

Any comments are appreciated!

SHATTER.3dm (49.1 KB)
SHATTER.gh (10.8 KB)

In this case you could sort the segments by length and then take the longest length. But I assume this is a small part of a bigger definition so whether or not this will work will depend on what you want to achieve.
SHATTER.gh (13.6 KB)

Thanks Siemen,

It is part of a larger definition. Your version works for the purpose absolutely, however, I need the list to sort back to its original order … is it possible??

So I just use a stupid way…