Is there a native way component to assing items to branches using integers as a mask? Elefront’s “Create Tree” component somehow works but doesn’t respect initial hierarchy of branches.
This is what I came up with using C#. I am just curious if there’s a better easier way.
DataTree<Curve> assignedItems = new DataTree<Curve>();
for (int i = 0; i < I.BranchCount; i++) {
GH_Path actualPath = new GH_Path(i);
for (int j = 0; j < I.Branch(actualPath).Count; j++) {
int p = M.Branch(i)[j];
GH_Path newPath = new GH_Path(i, p);
assignedItems.Add(I.Branch(i)[j], newPath);
}
}
R = assignedItems;