Conditional visibility of array parameters
mahir
Member, Developers Posts: 1,324 ✭✭✭✭✭
Is it possible to have a parameter array whos individual sub-parameters can be driven by array-level logic? I don't know why, but the below precondition code does not work. I get tagged with an error on the boolean condition of the if statement. It looks like I can't reference individual "arrayVar" parameters. Is there a way to make it work?
<div>annotation { "Name" : "Array Variables", "Item name" : "Array Var"}
definition.arrayVars is array;
for (var arrayVar in definition.arrayVariables)
{
annotation { "Name" : "Par1", "UIHint" : "DISPLAY_SHORT"}
isLength(arrayVar.par1, LENGTH_BOUNDS);
</div><div>annotation { "Name" : "Par2", "UIHint" : "DISPLAY_SHORT" }<br></div><div> arrayVar.par2 is boolean;
if (arrayVar.par2)
{
annotation { "Name" : "Par3" }
isLength(arrayVar.par3, LENGTH_BOUNDS);
}
}</div>
Tagged:
0
Best Answer
-
You're right, currently there's no way to make it work. You can control visibility of parameters based on other parameters outside the array, but not based on other parameters inside the array.
This feature is somewhere along our horizon of desired improvements. You can file and improvement request to speed it along!
5
Answers
-
You're right, currently there's no way to make it work. You can control visibility of parameters based on other parameters outside the array, but not based on other parameters inside the array.
This feature is somewhere along our horizon of desired improvements. You can file and improvement request to speed it along!
5 -
Here's the enhancement request.
https://forum.onshape.com/discussion/7628/conditional-visibility-of-array-parameters/
0

