In my definition I’m trying to create a C# script that loops through a list of numbers (such as 1 - 100) that increments by 10. After the series of numbers has reached 100, I want to restart at the next first number in the list and keep looping until every number in the 1-100 list has been accounted for.
At the moment, the group of components with multiple series is working exactly how I want the definition to work, but it’s inefficient.
The C# script I created is kind of working, but it doesn’t restart at the first number after its counted through the list. Here is the code for the C# script:
int listLength = 100;
int stepSize = 10;
int amountOfBranches = listLength / stepSize;
DataTree<int> tree = new DataTree<int>();
int count = 0;
for (int i = 0; i < amountOfBranches; i++)
{
// Print(i.ToString());
GH_Path path = new GH_Path(i);
for(int j = 0; j < listLength; j += stepSize)
{
tree.Add(count, path);
count += stepSize;
}
}
A = tree;
Any insight or advice would be greatly appreciated.
loopThroughList_V1.gh (9.1 KB)