LoopWhile nodes

Hi All! Again I’m still trying to make a loop while still can’t do it ! Any help ???

Hello,

I’m not strong enough in explaining the LoopWhile node (I only understand the one in the dynamo dictionary)

but there is this way
Capture d’écran 2022-08-01 181117

Cordially
christian.stan

2 Likes

If you look at the inputs for LoopWhile you’ll see that continueWhile and loopBody both take functions. You would need to connect the nodes like this:

However, what I think @christian.stan is trying to say is that there’s no need for the LoopWhile node in this case. Dynamo already iterates each object in a list, allowing you to apply write a function for a range of inputs instead of forcing a loop.

3 Likes

Thanks all for helping out ! But I still don’t understrand the meaning of an empty node (x ) in our case ??

1 Like

Hello,
i think somehow x=(i) is the loop variable
this is why the entrance must remain free (and y the direction and the “stop” of the loop)
Cordially
christian.stan

2 Likes

The “empty” value is required for a function and where the current iterative value is passed on evaluation. The continueWhile function is run on every iteration to make sure that the While condition is still valid. The loopBody function is run on every iteration as the “change” made to the value as long as the While condition is met.

In your example a While Loop isn’t actually needed since you’re just creating a sequence.

1 Like