Python loop through data trees {A;B;C;D}(i)

rhino
grasshopper
python

(Jake) #1

I am trying to loop through each branch at multiple levels of my data tree.
The structure of the tree is {A;B;C;D} (i).

I have looped through simple trees before with

for i in range(Tree.BranchCount):
branchList = Tree.Branch(i)
for j in range(branchList.Count):

I am trying to loop through A then loop through B within A’s loop… and so on.

Am I thinking about this the wrong way?

Thanks for the help,
Jake


#2

See Giulio’s generic datatree functions here: https://gist.github.com/piac/ef91ac83cb5ee92a1294