2025-10-06 03:30 PM
I am trying to find a way to restrict user inputs for an integer parameter to only even numbers. What is the best way to do this?
For context: I have an integer parameter set up that allows a user to set the number of lite divisions in a window. In the vertical direction, the lites are divided between two sashes, so the number must be even or it throws off other dimensions. I could use a values command to create a list of available inputs, but I would like to find another way to restrict inputs to only even numbers if possible.
2025-10-06 03:46 PM
Fortunately that's possible and done easily:
By using the "step" command you can choose start and step from there one.
All done in Parameter script.
2025-10-06 03:52 PM
I would offer a VALUES list with the values 2, 4, 6, 8, etc., as this is the clearest for the user.
Something like this would also work:
VALUES ‘anz’ RANGE[2, ] STEP 2, 2
Then odd values are rounded up to the next higher even value.
You can do something similar with PARAMETERS if you don't want the somewhat confusing limit indicator in the input field.