Picking items from a tree in a grid

For that I usually use tree statistics, which outputs the branch path (the number in the curly brackets). So you just get the 2nd list item from that HOW
Then you use Tree Branch to retrieve that specific branch. HOW
Now you can use List Item to get the specific item you are after.

David, thank you for this work

I guess I want a module that spits out branches based on a numeric input like the number 6, or the result of a calculation with an EXPRESSION module.

Then I want to pick cherries from the branch at specific locations with another integer.

i dont want to type curly brackets with array locations in them. Is there a curly bracket module that takes integers as input?

I tried some connections - no luck : /

TreeBranches 001.gh (16.6 KB)

The immediate goal is to calculate the area of one selected square.

then all the squares - to find the mean, largest and smallest, and count.

I don’t think this is what you are after; TreeBranches 001_ME.gh (11.4 KB)
For picking a specific path you don’t need those brackets. If you don’t want use simplify, you are able to pick a path by using concatenate with semicolon as separator.

Thank you for that. I would not have thought to use CONCAT to make a text string as input. I assumed I had missed a module that took integers as an input.

I have no problem using SIMPLIFY, I just could not get anything to work even with simplified data. Modifying your example does not prove successful either.
ADDED - i figured out you used a semicolon in the CONCAT and removing that creates the required text string

I am also curious how you learned these tree tricks? Is it just years of attention to detail or is there some text that covers these kinds of data manipulation?

I dont fully understand what it is you are trying to achieve, and I guess there is a reason you are not using the Cell output form the grid directly, but here is another approch using a similar method to your first attempt.

TreeBranches 001_ME_V2.gh (13.4 KB)

Wow, that is a level of cleverness I can barely believe.
The grid module is a proxy for the intersections of a set of lines in the model.
The challenge (for me) is pruning the tree artfully.

I wanted to post this as the example, but I cannot understand why all the curves do not intersect.


TorpedoArea 001.gh (7.8 KB)

The task is to calculate the area of each square

You just need to flatten one of your intersection inputs.

1 Like

Again, not entirely sure, but this might help you towards your goal.

You just need to add some exeptions for where there are diffences in the number of intersection. But its a little late here now to keep looking at it. I hope it helps.

Area 001_V2.gh (11.6 KB)