If statement that returns 1 only if the value entered is 0

If statement that returns 1 only if the value entered is 0

tusharjoshi97
Explorer Explorer
351 Views
3 Replies
Message 1 of 4

If statement that returns 1 only if the value entered is 0

tusharjoshi97
Explorer
Explorer

Hi there,

How would I write an 'If statement' for rotation angle that specifies that if the value entered is zero, use a value of 1 instead.

 

Thanks .

 

Screenshot 2023-06-09 000322.png

0 Likes
Accepted solutions (1)
352 Views
3 Replies
Replies (3)
Message 2 of 4

ToanDN
Consultant
Consultant
Accepted solution

You need one input parameter and one output parameter.  Use this formula for the output parameter: if (input = 0, 1, input).  

0 Likes
Message 3 of 4

tusharjoshi97
Explorer
Explorer

Yeah I was hoping to avoid creating another parameter just to use as an input for this one but I guess there isn't any other choice. 

Thanks a ton

0 Likes
Message 4 of 4

mhiserZFHXS
Advisor
Advisor

It'd be lovely in parameters were able to have "under the hood" controls and settings to set things like min or max values, but unfortunately they don't. But hey, they are at least supposedly making it so arrays can have values of 1 or 0 without having to add a bunch of control parameters and duplicate model elements.

0 Likes