Hello,
I’m trying to apply an expression via gh but It doesn’t seem to work.
What am I wrong?
See attached
Thank you
I would spell “and” as a word
Thank you,
I tried as attached but there is still some problem.
From expression If(a=“Referenced wall” and y=False), 0,“”)
I obtain 2 conditions:
a=“Referenced wall” and b=False ---- obtain — 0
a=“Referenced wall” and b=True ---- obtain — “”
So if I modify “a” with another text for e.g. Referenced space (as attached video)
I think that the expression is “False” for each case of b=True or b=False, therefore the result is always “”, but this seems not to be the case.
Thank you again for any suggestion.
You are mixing up the logical condition False and the text string “False”. Panels are for displaying text, so if you feed a boolean switch into a panel the logical value output by the switch is converted to a text string and that string is not equal to the value it represents.
If you want to equate to False in the expression, feed the boolean switch output directly into it.
Secondly, there appears to be an issue with the way gh is evaluating your expression so it is giving incorrect outputs. If you add in the two pairs of parentheses that Laurent suggested:
the expression evaluates correctly.
These parentheses should not be necessary as operator precedence should see the two comparisons being processed before the and, but leave them out and the result is wrong:
Incidentally, the & is a string concatenation operator.
Regards
Jeremy