# If statement not working as intended

**URL:** <https://forum.dynamobim.com/t/if-statement-not-working-as-intended/73603>\
**Category:** Uncategorized\
**Created:** [February 22, 2022, 3:04pm UTC](https://forum.dynamobim.com/t/if-statement-not-working-as-intended/73603 "2022-02-22T15:04:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![carsosAHL8V](https://avatars.discourse-cdn.com/v4/letter/c/3da27b/32.png) [@carsosAHL8V](https://forum.dynamobim.com/u/carsosAHL8V)\
**Post date:** [February 22, 2022, 3:04pm UTC](https://forum.dynamobim.com/t/if-statement-not-working-as-intended/73603/1 "2022-02-22T15:04:06Z")

</div>

I want to run a script that calculate the length of a run. It works exactly as intended when there are many items (conduits and fittings) in the whole run. But it doesn’t work when it is only one element in the run. I noticed that the if statement is not working as intended as you can see in the image below. I should get the true condition since the input is true, right? I tried ScopeIf as suggested in another forum question without any luck.  
Can anybody point me to a solution for this?  
Thanks in advance

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

---

<div class="post-metadata">

**Author:** ![Manel\_Fernandez](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/manel_fernandez/32/9123_2.png) [@Manel\_Fernandez](https://forum.dynamobim.com/u/Manel_Fernandez)\
**Post date:** [February 22, 2022, 3:14pm UTC](https://forum.dynamobim.com/t/if-statement-not-working-as-intended/73603/2 "2022-02-22T15:14:17Z")

</div>

Hi there,

It works for me:

 ![imagen](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/e/6e160891eab164f49b6fdeb52a50fc6cc56cb8d1.png)

Revit version? Dynamo?

Manel

---

<div class="post-metadata">

**Author:** ![carsosAHL8V](https://avatars.discourse-cdn.com/v4/letter/c/3da27b/32.png) [@carsosAHL8V](https://forum.dynamobim.com/u/carsosAHL8V)\
**Post date:** [February 22, 2022, 3:20pm UTC](https://forum.dynamobim.com/t/if-statement-not-working-as-intended/73603/3 "2022-02-22T15:20:24Z")

</div>

Revit 2020, Dynamo 2.3

---

<div class="post-metadata">

**Author:** ![Manel\_Fernandez](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/manel_fernandez/32/9123_2.png) [@Manel\_Fernandez](https://forum.dynamobim.com/u/Manel_Fernandez)\
**Post date:** [February 22, 2022, 3:22pm UTC](https://forum.dynamobim.com/t/if-statement-not-working-as-intended/73603/4 "2022-02-22T15:22:32Z")

</div>

Your If node doen’t have Lacing control. That’s why I thought it was and old dynamo version.

Try to connect conduit collector to the if node without list.create node.

 ![imagen](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/6/e6901d0af26df8e48b38333f7106991b29cadaed.png)

I thing it is a level list control issue.

Manel

---

<div class="post-metadata">

**Author:** ![carsosAHL8V](https://avatars.discourse-cdn.com/v4/letter/c/3da27b/32.png) [@carsosAHL8V](https://forum.dynamobim.com/u/carsosAHL8V)\
**Post date:** [February 22, 2022, 3:30pm UTC](https://forum.dynamobim.com/t/if-statement-not-working-as-intended/73603/5 "2022-02-22T15:30:50Z")

</div>

still, not working

---

<div class="post-metadata">

**Author:** ![Manel\_Fernandez](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/manel_fernandez/32/9123_2.png) [@Manel\_Fernandez](https://forum.dynamobim.com/u/Manel_Fernandez)\
**Post date:** [February 22, 2022, 3:33pm UTC](https://forum.dynamobim.com/t/if-statement-not-working-as-intended/73603/6 "2022-02-22T15:33:36Z")

</div>

Don’t really know what happend. It works for me just controling Lacing.

 ![imagen](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/7/b7e7bcbf903c043b20ab67958a3b38dac714aa40.png)

Manel

---

<div class="post-metadata">

**Author:** ![carsosAHL8V](https://avatars.discourse-cdn.com/v4/letter/c/3da27b/32.png) [@carsosAHL8V](https://forum.dynamobim.com/u/carsosAHL8V)\
**Post date:** [February 22, 2022, 3:38pm UTC](https://forum.dynamobim.com/t/if-statement-not-working-as-intended/73603/7 "2022-02-22T15:38:22Z")

</div>

Well, Thanks Manel for your time. As I said before, it works well when there are more than 1 item in the run. I just wanted it to work in all cases possible.
