How can I get Results for every iteration in a loop

Hello everyone. I have a simple loop which stops after 3 iteration and gives me result of last iteration. I want to have results for every iteration not only last one. How can I do that ?

Create a list object before the loop and use the .append() method to add each iteration outcome to it.

Thats if you do it all in python. If you want to do loopwhile and nodes im unsure if dynamo can achieve that internally.

The LoopWhile node does not return iterative results, only the end result once the loop is closed. In many cases you can “calculate” each step and take a prescriptive approach instead of looping anyway.

1 Like

I can not do it all in python. I am using structural analysis package inside the loop and I am getting max stress as a result . I want to record max stresses for each iteration.

thanks for your answer but I need to use loop for genetic algorithm.

Actually I have managed to get results for each iteration.

But still need better ideas about list management.

I have found the solution, if anyone needs to get result from each iteration can use this way.