Hello Dynamo people!
We have changed the functionality of the “If” node in Dynamo. Previously the “If” node would work like a conditional statement, similar to the inline condition in DesignScript. So when the ‘trueValue’ and ‘falseValue’ had list values of different lengths it would replicate over the shortest length. This was a little confusing to the users as they were seeing unexpected output. The same would happen with empty lists and null values.
To avoid this confusion, we have decided to update the “If” node functionality and the node would directly return the complete ‘trueValue’ or ‘falseValue’ based on the input ‘test’ condition. This would handle lists of different lengths, empty lists and null values. If the ‘test’ has a list of boolean values, the output of the “If” node will replicate on that list. Note that this node will replicate only on the ‘test’ input parameter.
We have a Dynamo build which has this new node and for now, this new node has the same name. We encourage you to try this build out and let us know if think of any other changes. We will be glad to incorporate them.
The old node is hidden from the library and the new node can be used. We are supporting backwards compatibility for this node till we completely obsolete the old “If” node. If you open up any old graphs with the “If” node, the graph will execute like before and the node will show a warning message to update it.
- Original thread regarding the “If” node: [Request for Feedback] If Node
- Sandbox Daily Build to test the new “If node” available here. Please either use
7Zipto unzip, or manually unblock the ZIP file before opening, as discussed below:
In order to use the DynamoCoreRuntime.zip files on windows operating systems, please use 7zip to extract the files or alternatively, manually unblock the zip archive before unzipping it. For more information on the DynamoCoreRuntime builds and how to setup your machine please see our wiki page.
New_If_Node.dyn (152.6 KB)