Iterating (or for-each) through a group of breps

I am constructing a cage-like structure using 2x2 lumber. I have arranged the necessary 2x2x??’ brep pieces to be cut from 8 foot lengths, and each piece is named:


What I want to do is:

  1. Select the 2-3 pieces that make up one 2x2x8’ board.
  2. Display a panel that lists each piece’s name and length.

More importantly, what I’d like to do is learn how to do this in Grasshopper without using a plugin that provides for-each looping. I’m getting close, but not close enough:

Grasshopper.gh (13.3 KB)

Can anyone nudge me in the correct method to do this? Thanks, in advance!