# IF node

**URL:** <https://forum.dynamobim.com/t/if-node/2271>\
**Category:** Packages\
**Created:** [September 29, 2015, 1:39pm UTC](https://forum.dynamobim.com/t/if-node/2271 "2015-09-29T13:39:21Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lennart](https://avatars.discourse-cdn.com/v4/letter/l/b9bd4f/32.png) [@Lennart](https://forum.dynamobim.com/u/Lennart)\
**Post date:** [September 29, 2015, 1:39pm UTC](https://forum.dynamobim.com/t/if-node/2271/1 "2015-09-29T13:39:21Z")

</div>

Hi there,

This feels like a stupid question, but I’m having difficulties with the IF-node…

If the ‘true’ and ‘false’ inputs are lists with different lengths, the output of the node is a list with the length of the shortest input-list:

![Capture4](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/8/8752091107cb0614ba847149b7ef1ef86e7b93a6.png)

&nbsp;

&nbsp;

&nbsp;

Am I overlooking something, or is this a bug?

&nbsp;

Thanks in advance

---

<div class="post-metadata">

**Author:** ![john\_pierson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/john_pierson/32/191977_2.png) [@john\_pierson](https://forum.dynamobim.com/u/john_pierson)\
**Post date:** [September 29, 2015, 2:35pm UTC](https://forum.dynamobim.com/t/if-node/2271/2 "2015-09-29T14:35:24Z")

</div>

I think it was on purpose for it to lace over the input correctly? Logic.IF from package zebra will do what you want.

![2015-09-29_14h04_07](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/3/316ea8ed37708f435fb865cacf9bba482b9b30a6.png)

![2015-09-29_14h03_27](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/1/148a9ed1fbb06f2695a2d161b95da8c14badcb28.png)

---

<div class="post-metadata">

**Author:** ![john\_pierson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/john_pierson/32/191977_2.png) [@john\_pierson](https://forum.dynamobim.com/u/john_pierson)\
**Post date:** [September 29, 2015, 2:38pm UTC](https://forum.dynamobim.com/t/if-node/2271/3 "2015-09-29T14:38:55Z")

</div>

Or scope.if it seems.

![2015-09-29_14h07_22](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/1X/09e954f75a1666bc5a392e82e0841c98d30bd999.png)

---

<div class="post-metadata">

**Author:** ![Vikram\_Subbaiah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vikram_subbaiah/32/50797_2.png) [@Vikram\_Subbaiah](https://forum.dynamobim.com/u/Vikram_Subbaiah)\
**Post date:** [September 29, 2015, 9:30pm UTC](https://forum.dynamobim.com/t/if-node/2271/4 "2015-09-29T21:30:02Z")

</div>

Or, you could use Design Script

![20150930-1](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/c/c75b8c0099f8b1ceac50c17d0da15d7f3c9d32e3.jpg)

---

<div class="post-metadata">

**Author:** ![Lennart](https://avatars.discourse-cdn.com/v4/letter/l/b9bd4f/32.png) [@Lennart](https://forum.dynamobim.com/u/Lennart)\
**Post date:** [September 30, 2015, 1:37am UTC](https://forum.dynamobim.com/t/if-node/2271/5 "2015-09-30T01:37:34Z")

</div>

Thanks for your reactions.

ScopeIf does the job, although I’m not sure this is the only difference between If and ScopeIf.

A better description of these two nodes would be helpful I guess, other than ‘Conditional statement’ and ‘Scoped If statement’

---

<div class="post-metadata">

**Author:** ![Lennart](https://avatars.discourse-cdn.com/v4/letter/l/b9bd4f/32.png) [@Lennart](https://forum.dynamobim.com/u/Lennart)\
**Post date:** [September 30, 2015, 3:35am UTC](https://forum.dynamobim.com/t/if-node/2271/6 "2015-09-30T03:35:54Z")

</div>

Edit:

It seems ScopeIf won’t works for nested lists as True/False input.

I don’t know anything about Design Script, so I’m trying to avoid it, if possible 🙂

&nbsp;

Here’s what I’m trying to achieve:

If want to create an option for users (preferably via a Boolean node) to choose between two lists (different lengths) with sublists of 6 points:

![Capture5](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/d/d940ffaa2e37b1d70df96d7d76acffb19dabb5a1.png)

‘If’ works, but it picks the length of the shortest list

‘ScopeIf’ doesn’t work (after 10 seconds of calculations):

![Capture6](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/0/094c2fe4a83d286e5878ea590d1ddddef42e4f98.jpg)

Logic.If from Zebra (old If-node) seems to work:

![Capture7](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/1/11ff37d4a520fe1d624a3cf7b003fad3c4045510.png)

&nbsp;

---

<div class="post-metadata">

**Author:** ![john\_pierson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/john_pierson/32/191977_2.png) [@john\_pierson](https://forum.dynamobim.com/u/john_pierson)\
**Post date:** [September 30, 2015, 7:57am UTC](https://forum.dynamobim.com/t/if-node/2271/7 "2015-09-30T07:57:47Z")

</div>

There’s a node it Rhythm for having a choice between two options. It is called Ayuda.ThisOrThat

I use it all of the time when I need to switch what a graph does.

![2015-09-30_07h26_01](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/3/304f509a9676188dc6eb5197c47fe38c1277391a.png)

---

<div class="post-metadata">

**Author:** ![Paul\_Wintour](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/paul_wintour/32/9381_2.png) [@Paul\_Wintour](https://forum.dynamobim.com/u/Paul_Wintour)\
**Post date:** [November 1, 2015, 9:46pm UTC](https://forum.dynamobim.com/t/if-node/2271/8 "2015-11-01T21:46:38Z")

</div>

It would be good if the IF node was updated. I’m not sure what ScopeIf does but it crashes all the time

---

<div class="post-metadata">

**Author:** ![Dimitar\_Venkov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/dimitar_venkov/32/2068_2.png) [@Dimitar\_Venkov](https://forum.dynamobim.com/u/Dimitar_Venkov)\
**Post date:** [November 1, 2015, 10:37pm UTC](https://forum.dynamobim.com/t/if-node/2271/9 "2015-11-01T22:37:36Z")

</div>

“ScopeIf” was used for recursions inside custom nodes. (not sure if node recursion is still supported, I haven’t used it in a long time) I guess the team forgot to update it to handle lists, similar to the standard “If” node in version 0.81.

Because “ScopeIf” was meant only for use inside custom nodes, I would refrain for using it in the main graph. You can try the following work-around for using the default “If” node with unequal length input lists and a single Boolean value:

![2015-11-02_12-22-52](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/f/fe7f367b13df8b6614760b33e17bc1b2ef26327b.png)

---

<div class="post-metadata">

**Author:** ![fluffyhugger](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/fluffyhugger/32/54396_2.png) [@fluffyhugger](https://forum.dynamobim.com/u/fluffyhugger)\
**Post date:** [August 19, 2018, 1:30pm UTC](https://forum.dynamobim.com/t/if-node/2271/10 "2018-08-19T13:30:13Z")

</div>

Why the images aren’t clickable?

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [August 19, 2018, 1:47pm UTC](https://forum.dynamobim.com/t/if-node/2271/11 "2018-08-19T13:47:42Z")

</div>

> [@Viewing Images from the old Forum](https://forum.dynamobim.com/t/viewing-images-from-the-old-forum/18029):
>
> Hi I have found the solution to my question but it is back from 2015 forum. [https://forum.dynamobim.com/t/xyz-point-coordinate-list/994](https://forum.dynamobim.com/t/xyz-point-coordinate-list/994). Rather than ask again, is there way to view the images posted in the answers in the forum post? Thanks CO

---

<div class="post-metadata">

**Author:** ![fluffyhugger](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/fluffyhugger/32/54396_2.png) [@fluffyhugger](https://forum.dynamobim.com/u/fluffyhugger)\
**Post date:** [August 19, 2018, 2:34pm UTC](https://forum.dynamobim.com/t/if-node/2271/12 "2018-08-19T14:34:45Z")

</div>

much obliged
