Choosing correct brep from list based on area logic. Need middle area brep

I have a situation where depending on the input brep translations, after a brep split I have either 2 or 3 resulting breps.

If there’s two, I want to work with the smaller (area) one. If there’s three in the result, I want the middle area one.

I have a grip on how to sort a list of breps by area, then choose the biggest or smallest. But I’m stuck at how to do deal with the varying list length and getting the middle sized one if there’s three in the list.

It sounds like you want to sort them by area and then use List Item to choose the next to last one. Index value would be list length minus two (because lists are zero-based).

Or reverse the sorted list and always use index value = 1.

1 Like

Thanks Joseph. Yes that’s exactly what I want. Seems simple. Hah I had like all these like conditional structures swirling in my head like if list length = whatever and so on.