# LoopWhile nodes

**URL:** <https://forum.dynamobim.com/t/loopwhile-nodes/79385>\
**Category:** Lists-Logic\
**Created:** [August 1, 2022, 3:38pm UTC](https://forum.dynamobim.com/t/loopwhile-nodes/79385 "2022-08-01T15:38:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahmed\_Ramy](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@Ahmed\_Ramy](https://forum.dynamobim.com/u/Ahmed_Ramy)\
**Post date:** [August 1, 2022, 3:38pm UTC](https://forum.dynamobim.com/t/loopwhile-nodes/79385/1 "2022-08-01T15:38:34Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/e/7e90d3b1fa414f9f520a751e52766ad371eaee86.png)

---

<div class="post-metadata">

**Author:** ![christian.stan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/christian.stan/32/166296_2.png) [@christian.stan](https://forum.dynamobim.com/u/christian.stan)\
**Post date:** [August 1, 2022, 4:12pm UTC](https://forum.dynamobim.com/t/loopwhile-nodes/79385/2 "2022-08-01T16:12:41Z")

</div>

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](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/7/7713fd3374ef014338c0e397e8bf9eff49480d7f.jpeg)

Cordially  
christian.stan

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [August 1, 2022, 4:52pm UTC](https://forum.dynamobim.com/t/loopwhile-nodes/79385/3 "2022-08-01T16:52:06Z")

</div>

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:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/8/5896e75e216d4aefcfdf77afd8c2d60e62e9ebd9.png)

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.

---

<div class="post-metadata">

**Author:** ![Ahmed\_Ramy](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@Ahmed\_Ramy](https://forum.dynamobim.com/u/Ahmed_Ramy)\
**Post date:** [August 3, 2022, 9:38am UTC](https://forum.dynamobim.com/t/loopwhile-nodes/79385/4 "2022-08-03T09:38:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![christian.stan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/christian.stan/32/166296_2.png) [@christian.stan](https://forum.dynamobim.com/u/christian.stan)\
**Post date:** [August 3, 2022, 9:54am UTC](https://forum.dynamobim.com/t/loopwhile-nodes/79385/5 "2022-08-03T09:54:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [August 3, 2022, 1:32pm UTC](https://forum.dynamobim.com/t/loopwhile-nodes/79385/6 "2022-08-03T13:32:04Z")

</div>

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.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/4/b41378c5fbdf2012b18679d5084fe2cf332209ee.png)
