Iterating Through Grasshopper Cluster Outputs and Breaking Condition

Hello everyone,

I’m currently working on a Grasshopper project where I have a cluster with an input parameter “i1” and an output parameter “o1”. The goal is to iterate through the outputs of this cluster, passing the value of “o1” back to the input parameter “i1”, and repeating this process until the value of another output parameter “o2” becomes 1. Once “o2” reaches 1, I want the iteration to stop.

I’ve attempted to implement this logic using GhPython scripting, but I’m encountering challenges in setting up the iteration and breaking condition within the Grasshopper environment.

Could anyone provide guidance or suggest an approach on how to achieve this iteration process and breaking condition in Grasshopper?

Any help or insights would be greatly appreciated. (7.0 KB)

Ignoring your Python code with the intent of implementing a simple Anemone loop, I see that your name1 cluster ‘o2’ output is not connected or internalized? So any loop is pointless.


@Joseph_Oster thanks for your note . I update the file here (7.7 KB)

But with the values and terminating condition using Equality the loop will never terminate. So I changed the test to ‘>=’, using Anemone. Silly exercise isn’t it?

loop_2024Mar9a2 (9.4 KB)

@Joseph_Oster , thenaks for your feed back again . but the main issue is I want replace Anemone loop with python component! how to achieve that?