# IFnode. Can I get full list out of it?

**URL:** <https://forum.dynamobim.com/t/ifnode-can-i-get-full-list-out-of-it/26446>\
**Category:** Uncategorized\
**Tags:** revit, dynamo\
**Created:** [September 26, 2018, 8:15am UTC](https://forum.dynamobim.com/t/ifnode-can-i-get-full-list-out-of-it/26446 "2018-09-26T08:15:44Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![verdi](https://avatars.discourse-cdn.com/v4/letter/v/b38774/32.png) [@verdi](https://forum.dynamobim.com/u/verdi)\
**Post date:** [September 26, 2018, 8:15am UTC](https://forum.dynamobim.com/t/ifnode-can-i-get-full-list-out-of-it/26446/1 "2018-09-26T08:15:44Z")

</div>

Gooe day guys ,

I used the IF node and noticed that it returns a list as big as the smallest one. Does someone know how to get the whole list ? Ive tried multiple combinations.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/f/1f3765a2f24a8b88682a6aa647a15722b40a743c.png)  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/c/4c94a19358d64305974471e82e1b1213ff672c5d.png)

Please help.

---

<div class="post-metadata">

**Author:** ![Avz](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/avz/32/50605_2.png) [@Avz](https://forum.dynamobim.com/u/Avz)\
**Post date:** [September 26, 2018, 8:23am UTC](https://forum.dynamobim.com/t/ifnode-can-i-get-full-list-out-of-it/26446/2 "2018-09-26T08:23:54Z")

</div>

A thing to note about the `If` node is that it evaluates _both_ outcomes, regardless of the input. It may be that it tries to keep the lists of matching size so as to not mess up the conditions for following nodes…  
If the true and false conditions are independent of each other, you can try using the `ScopeIf` node instead, which will first evaluate the condition and _then_ the respective true or false input exclusively.

---

<div class="post-metadata">

**Author:** ![mellouze](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@mellouze](https://forum.dynamobim.com/u/mellouze)\
**Post date:** [September 26, 2018, 8:33am UTC](https://forum.dynamobim.com/t/ifnode-can-i-get-full-list-out-of-it/26446/3 "2018-09-26T08:33:47Z")

</div>

Hi,

Have you tried the Imperative block ?

![2018-09-26%2010_23_24-Dynamo](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/9/59b47617933bc679c9197fdc2dd6e106fdfc3a65.png)

![2018-09-26%2010_23_25-Dynamo](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/d/0dd98f35988d3d15b39ba287a8c5df417879d3be.png)

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [September 26, 2018, 8:35am UTC](https://forum.dynamobim.com/t/ifnode-can-i-get-full-list-out-of-it/26446/4 "2018-09-26T08:35:35Z")

</div>

Or Python  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/0/d0214b29d491ac7c852775959feaf059fedf0ded.png)  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/4/e47e5685894e58810d8f62f0b1a48e7539f1a6f4.png)

Or clockwork node:  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/6/068dbfafeb78594d728400057f7561f1b50797e4.png)  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/6/661d88a0eb13b75214a588917c7efdcefcdfbc7b.png)

---

<div class="post-metadata">

**Author:** ![verdi](https://avatars.discourse-cdn.com/v4/letter/v/b38774/32.png) [@verdi](https://forum.dynamobim.com/u/verdi)\
**Post date:** [September 26, 2018, 8:37am UTC](https://forum.dynamobim.com/t/ifnode-can-i-get-full-list-out-of-it/26446/5 "2018-09-26T08:37:45Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/9/1973f33f7647a941e23a36822c70a828cf6c1db3.jpeg)

Works perfectly. Thanx !!

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [September 26, 2018, 8:38am UTC](https://forum.dynamobim.com/t/ifnode-can-i-get-full-list-out-of-it/26446/6 "2018-09-26T08:38:28Z")

</div>

@Avz & @verdi Be careful of using the OOTB “ScopeIf” node without knowing the implications of this… It is NOT behaving like all other nodes in Dynamo as it does not compute the untrue statement which might cause a failure in your Dynamo system.  
The ScopeIf+ from clockwork however works like you would expect.

The “error” / danger of the scopeif node have been reported here:

> <https://github.com/DynamoDS/Dynamo/issues/9111>

---

<div class="post-metadata">

**Author:** ![verdi](https://avatars.discourse-cdn.com/v4/letter/v/b38774/32.png) [@verdi](https://forum.dynamobim.com/u/verdi)\
**Post date:** [September 26, 2018, 8:39am UTC](https://forum.dynamobim.com/t/ifnode-can-i-get-full-list-out-of-it/26446/7 "2018-09-26T08:39:50Z")

</div>

Something I will test. Thanx for the headsup. If that is the case I will try the python script.

---

<div class="post-metadata">

**Author:** ![Avz](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/avz/32/50605_2.png) [@Avz](https://forum.dynamobim.com/u/Avz)\
**Post date:** [September 26, 2018, 8:40am UTC](https://forum.dynamobim.com/t/ifnode-can-i-get-full-list-out-of-it/26446/8 "2018-09-26T08:40:15Z")

</div>

Point being, an imperative evaluation is required in some shape way or form 😉

I nevertheless do think it’s strange though that the `If` node’s output is tied to the shortest input even when they’re entirely independent, and there are no lacing options…

I know about the “dangers” of the `ScopeIf`, which is why I expressly mentioned **independent** inputs.

---

<div class="post-metadata">

**Author:** ![mellouze](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@mellouze](https://forum.dynamobim.com/u/mellouze)\
**Post date:** [September 26, 2018, 8:43am UTC](https://forum.dynamobim.com/t/ifnode-can-i-get-full-list-out-of-it/26446/9 "2018-09-26T08:43:35Z")

</div>

> [@Avz](#):
>
> and there are no lacing options…

You can use lacing in a CodeBlock if you use the `bool?a:b` syntax 🙂 (e.g `bool?a<1L>:b<1>`)

(But I could not get it done even with this info).

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [September 26, 2018, 8:46am UTC](https://forum.dynamobim.com/t/ifnode-can-i-get-full-list-out-of-it/26446/10 "2018-09-26T08:46:24Z")

</div>

This was new for me… but have a look: ( I know it is not the desired output but quite neat applying lacing to nodes who doesn’t have it) 😉

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/a/da3ce0f12befac4dc32e3abcb31d55f31041d030.png)

---

<div class="post-metadata">

**Author:** ![mellouze](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@mellouze](https://forum.dynamobim.com/u/mellouze)\
**Post date:** [October 17, 2018, 12:10pm UTC](https://forum.dynamobim.com/t/ifnode-can-i-get-full-list-out-of-it/26446/11 "2018-10-17T12:10:44Z")

</div>

Don’t know if this can be of any interest to somebody (it is to me haha). I created a new If function that does not encounter the same problem as one can encounter with the If node. You can use it if you don’t want to create a new `Imperative` block each time you want to use an If statement.

```
def If(boole : bool, value1:var[]..[], value2:var[]..[]){
	return = [Imperative]{
		if(boole){
			return = value1;
		}else{
			return = value2;
		}
	}
};

```

 ![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/f/efef51a1c50532157155f15ce97e3d244585a6fe.png)

---

<div class="post-metadata">

**Author:** ![Mark.Ackerley](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mark.ackerley/32/79310_2.png) [@Mark.Ackerley](https://forum.dynamobim.com/u/Mark.Ackerley)\
**Post date:** [October 17, 2018, 1:50pm UTC](https://forum.dynamobim.com/t/ifnode-can-i-get-full-list-out-of-it/26446/12 "2018-10-17T13:50:08Z")

</div>

I love how elegant the clockwork code is…

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/f/2f99c80ebed1bec66d3d5b81ec0d8adf7abdba45.png)

---

<div class="post-metadata">

**Author:** ![mellouze](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@mellouze](https://forum.dynamobim.com/u/mellouze)\
**Post date:** [October 17, 2018, 2:06pm UTC](https://forum.dynamobim.com/t/ifnode-can-i-get-full-list-out-of-it/26446/13 "2018-10-17T14:06:54Z")

</div>

It is indeed !

---

<div class="post-metadata">

**Author:** ![Steven](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/steven/32/112504_2.png) [@Steven](https://forum.dynamobim.com/u/Steven)\
**Post date:** [October 17, 2018, 3:43pm UTC](https://forum.dynamobim.com/t/ifnode-can-i-get-full-list-out-of-it/26446/14 "2018-10-17T15:43:48Z")

</div>

Just saw this post and thought I would toss my suggestion in. This is how I have gotten around the IF problem. its a couple of extra node but all OTB.

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

---

<div class="post-metadata">

**Author:** ![mellouze](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@mellouze](https://forum.dynamobim.com/u/mellouze)\
**Post date:** [October 17, 2018, 3:50pm UTC](https://forum.dynamobim.com/t/ifnode-can-i-get-full-list-out-of-it/26446/15 "2018-10-17T15:50:32Z")

</div>

Thanks for the input 🙂 I guess it is the node version of the Clockwork node 😃

---

<div class="post-metadata">

**Author:** ![Steven](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/steven/32/112504_2.png) [@Steven](https://forum.dynamobim.com/u/Steven)\
**Post date:** [October 17, 2018, 5:45pm UTC](https://forum.dynamobim.com/t/ifnode-can-i-get-full-list-out-of-it/26446/16 "2018-10-17T17:45:22Z")

</div>

I think you are correct on that. I think it is also how _Ayuda.ThisOrTaht_ is built from rhythm package.

> **[Ayuda.ThisOrThat](https://dynamonodes.com/2016/02/05/ayuda-thisorthat/)**
>
> This node offers a single output from two variables via a boolean input. Source: 
