Can a list of iteration values operate on a list of looping data so different data values are iterated a different number of times? For example, I would like the letter A to have two “X”s added to it, but I want five “X’s” added to the letter B. I’ve tried grafting and simplifying the two input lists, but I can’t seem to get this to happen. Any help achieving this is greatly appreciated.
I tend to use Loops in GH when data is changing while looping, and the reason for that would be that it’s impossible for instance to forecast what would happen on future iteration 135
but if you know ahead, for each item, how many times you want it to be repeated, then next data is not depending on previously generated one, everything is “forecastable” from the beginning so I wouldn’t use a loop for that
I have a more complicated problem that could be solved if I learned how to perform a looping function with a list of iteration values paired with a list of data. This more general case is what I am looking to solve and I tried to illustrate the challenge with a fairly simple example.
Ok, so here is the real problem. If my past learning curve is any indication, I’m betting you will have some approach to this that does lighter work of all this than my initial forays into the problem.
I’m also attaching a cluster I wrote, hoping it might help my cause. Thanks for your help.
Using Deconstruct Path, you can convert these paths into lists of integers and manipulate these lists with components of the Set > List panel. The manipulated result (still a list of integers), can be returned to paths using the Construct Path component, and consolidated as a tree by plugging them into a Data Path container.
Furthermore, the action you are performing is basically the method of Trim Tree with a depth of 2. Though, to use Trim Tree the number times of based on path depth would require the use of Anemone. Better just to manipulate a list of integers.