Hi there,
I need to implement three different data manipulation scenarios (generate three different outputs). There should be a selection available for the end user. I wonder, is this the only way I can do it in Grasshopper+GhPython?
Since Python doesn’t know a “Switch”-statement, the common way in doing this is
using
if … :
elif …:
elif …:
In case you create high performing applications one day, this would reduce unnecessary conditional testing, because once it found one condition it doesn’t test for the remaining ones.
Furthermore I wouldn’t advise to write it like Amir proposed, unless for numbers, because its harder to read and it just can hold one statement. On the other hand, as long as you are doing scripting, nobody will care at all. So write it the way you like.