Organize grid of breps by branch?

organize grid.gh (14.6 KB)
Hello everyone! I have a grid of 4 by 4 breps and Instead of having them flattened in one list, I would like to have them organized in one tree with one branch for each column. How can I do that?

This can be a way of doing it.
Rounded X and Y coordinates of center points, then partitioned by count of set members in X, and lastly sorted by Y.
With the scale factor you can control the “rounding snap”, so this can even tolerate some level of misalignment and/or rotation… but not much.
Work safer with simple orthogonal grids.


organize grid_re.gh (16.8 KB)

1 Like

Thank you so much!!

What do I have to change if I want to organize them by row and not by column @maje90 ?

Use “Flip” component (to flip matrix) of the tree (out of “Srf” component in this example).
Note that it is best if you create the geometry as a tree to start with, rather that incur the overhead to sort it. I cases objects are not parallel to xy-plane, the solution might not work, etc.)

1 Like