boolean annotation default base on an enum
Hi,
i'm working on a featurescript with a selection driven array parameter that contains an Enum parameter and a Boolean parameter.
annotation { "Name" : "Flip wall", "UIHint" : UIHint.OPPOSITE_DIRECTION, "Default" : true }
wallShape.flipWall is boolean;
I'd like to set make the "Default" dependent on the chosen Enum. How can i do this?
the precondition doesn't allow to set/change variables. it also did not allow me to declare the same annotation twice (in an if/else)
Can it be done through editing logic? how can i get it to execute for each array parameter when the enum is changed?
Best Answer
-
Editing logic fires every time the user makes a change so that would work, however if the user has manually flipped it, you would have to have another (hidden) parameter to store that interaction otherwise it could become quite annoying if the flip status changed each time.
-OR-
You could have two parameters with different names, then check the value of the enum in the main body of the code to decide which flip to use.
Senior Director, Technical Services, EMEA0
Answers
-
Editing logic fires every time the user makes a change so that would work, however if the user has manually flipped it, you would have to have another (hidden) parameter to store that interaction otherwise it could become quite annoying if the flip status changed each time.
-OR-
You could have two parameters with different names, then check the value of the enum in the main body of the code to decide which flip to use.
Senior Director, Technical Services, EMEA0 -
the latter will be easiest I guess, should have thought of that myself.
0

