Hi, Can anyone help me with a work around for this to take the element when true. Also when theres an element in the empty I want it to take that one when its false.
The IF often fails when the 2 âanswersâ are of a different rank (ie a list and a value), itâs a lot more predictable when both items are lists or just 2 single items.
I believe you could also use the âScope ifâ node when working with empty lists
The normal if node does not handle empty lists inputs correctly, the scopeif node does.
Via Design Script:
indx = DSCore.List.IsEmpty(a) ? 0 : 1 ;
rslt = [a,b][indx];
Thank you for the replies but still need a little more help please
This worked but not for going the other way around.
My dynamo dosnât quite agree with the scope if node. I gave it a go before but it did odd things like corrupts the script then id have to copy the script to a new script for it to work again.
Iâm probably not implementing the design script correctlyâŚ
I put the [a,b] list backwards based on the previous indexing. My bad.