Dynamo icon indicating copy to clipboard operation
Dynamo copied to clipboard

Ternary operator returns Empty List operand regardless of boolean condition

Open xRadne opened this issue 4 years ago • 4 comments

Dynamo version

Dynamo Core 2.10.0.3455

Operating system

Windows 10

What did you do?

Ternary operator returns wrong value when any of the 2nd or 3rd operand is an empty list [].

image

What did you expect to see?

Expected true ? [0] : []; to be equal to [0] etc.

What did you see instead?

Got result [] (Empty List)

xRadne avatar Mar 12 '21 09:03 xRadne

Thank you for submitting the issue to us. We are sorry to see you get stuck with your workflow. While waiting for our team member to respond, please feel free to browse our forum at https://forum.dynamobim.com/ for more Dynamo related information.

github-actions[bot] avatar Mar 12 '21 09:03 github-actions[bot]

Hello @xRadne - We are aware of this issue and are currently improving the If Node and DesignScript If expression to better deal with empty lists and null values. You can check it out here: https://forum.dynamobim.com/t/request-for-feedback-refactored-the-if-node/60647/13

Amoursol avatar Mar 12 '21 13:03 Amoursol

to avoid the replication wrap this code inside an imperative block.

mjkkirschner avatar Apr 01 '21 23:04 mjkkirschner

tracked internally DYN-6223

avidit avatar Sep 06 '23 19:09 avidit