About if statement

Hello. I am working on a script which give out different results from different combination of bool input.
I am just familiar with dynamo package while barely know about coding.

As the picture shown, there are two input (True/False) and four kinds of output. The difficulty I met is I do not know how to present it correctly. Thanks if you could help me.

@TCKEAHY just remove the DSCore.if

1 Like

@TCKEAHY : not ;

1 Like

@tradelie Thanks a lot. My bad.

1 Like

To clarify a little bit, DesignScript uses a shorthand version of the If conditional statement, not a direct translation of the node. It actually matches a typical conditional statement (which returns true or false directly) except that an If statement returns something depending on if the condition is true or false.

The shorthand looks like this:

condition ? trueResult : falseResult;

where condition is the conditional If statement, trueResult is the output when the condition is true, and falseResult is the output when the condition is false.


Thank you for the supplement.

1 Like