It would be quite useful if the ParameterType property in ToolValidator was also writable, not read-only as it is now. When you can disable a parameter, it should be possible to make it optional! :-)
While we can't change the parameter type property, there is an approach to mimic the behavior you're looking for.
The strategy is to flip this around, and define the parameter as optional. And then in the tool's validation code, using your specific criteria, make the parameter appear required through validation, by forcing a parameter error. If you use either the 530 or 735 error ID in validation, the parameter will then show as required.
There's more information here in the Parameter topic:
-Dave
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.