algorithmic modeling for Rhino
Hi guys,
I have tree with n branches, in each branch I have n sub branches. Then in each of those sub-branches I have n elements. I am making a component in c# where I need to manage all the data. Now if I do '' tree.Branch(y)" it gives me the y sub branch. Is there a way of controlling the branch number as well as the sub branch number using 2 variables( example: "tree.Branch(x;y)" which gives the sub branch number y in the branch number x) ?
Thank you for your help.
Tags:
Hi Godjenka,
Use comma instead of semicolon when supplying a path to the Branch method:
tree.Branch(0,24,3) # access the 0;24;3 branch
Hi,
here is an example in C# syntax:
string result = string.Empty;
int j = 1; // <--- here you can choose the sub branch
for (int i = 0; i < Tree.Branches.Count; i++)
{
result = Tree.Branches[i][j].ToString();
}
A = result;
And speaking about trees and C#:
This counts subbranches, indices, cats, dogs ... whatever in variable (or not) trees. Useful when things are not "normalized" (rather the norm in most engineering cases, he he).
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by