Problem with sorting Breps based on a list

Hello All!

I trying to find an automatic way of selecting a surface with highest solar radiation reception among four design alternatives with help of Ladybug/Grasshopper.

After performing a solar radiation calculation with Ladybug, I tried to create a list of calculation outputs for each alternative, sort them, pick the highest bid, and feed it into a Item Index component with original unsorted list, in order to identify its index in original list, and then use that index to select the associated Brep (design alternative) for further operation.

But somehow Item Index list returns -1! Anyone has an idea what is going on?

Thanks in advance!

Ehsan

Vienna, Austria

p.s. Definition screenshot is attached …

This is a simple example that shows how you can sort the surfaces based on the results.

sort_faces.gh (395 KB)