Anemone within an Anemone (how to loop within a loop)

Hi everyone, I am trying to create a loop within a loop script using the anemone functions but I’m
having some difficultly getting the outcome I am looking for. My aim is to start a ‘classic’ anemone loop function which then contains a ‘fast’ anemone loop within that. Once the fast loop has completed the first iteration of data in the classic loop, the system will start again but on the second iteration of the classic loop and run through the whole of the fast loop again etc.

I have attached a simplified version of how I want to use this loop within a loop system where I am multiplying a series of simple numbers. The aim is to produce a tree list with the following results:

branch 1: 0, 0, 0, 0
branch 2: 2, 4, 6, 8
branch 3: 4, 8, 12, 16
branch 4: 6, 12, 18, 24

Any advice would be greatly appreciated!

Thanks
Cameron


GH loop in a loop.gh (15.3 KB)

missing

Use an “x-1” expression on the loop start ‘Repeat’ (or ‘Iterations’) inputs instead.

The Button component used to trigger Loop Start generates two events, triggering it twice. Better to use Boolean Toggle which requires a double-click but generates only one trigger event.

This example is contrived and sorta meaningless. Anemone is not needed for this. The output of List Item in the first (outer) loop is identical to its index value, which is the loop counter. ‘D1’ in the second (inner) loop never changes so doesn’t need to be a loop param.

Simplified?


loop in a loop_2021_Jul26c.gh (12.6 KB)

P.S. Oh yeah, your results without a loop:

loop in a loop_2021_Jul26b
loop in a loop_2021_Jul26b.gh (4.9 KB)

1 Like