The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
How to set Parameter on a Filter Example Operator
imanol_bidegain
Member Posts: 1 Learner III
Hi,
I'm trying to change the filter parameters of a Filter Example operator , I'm not sure how have to be written
Operator op = process.getOperator("Filter Examples (8)");
op.setParameter("ExampleFilter.PARAMETER_PARAMETER_STRING",??); // Here is where i don't know what to write.
I hope someone could help me, i'll be very greatful
I'm trying to change the filter parameters of a Filter Example operator , I'm not sure how have to be written
Operator op = process.getOperator("Filter Examples (8)");
op.setParameter("ExampleFilter.PARAMETER_PARAMETER_STRING",??); // Here is where i don't know what to write.
I hope someone could help me, i'll be very greatful
Tagged:
0
Answers
Hello there,
Here is how Operator.setParameter(String key, String value) works.
The first argument is the key, or the name of the parameter. The type is String, and usually, we refere these keys in the way
e.g.
In this way, you may code quicker, avoid type mistake, and keep your program stable.
The second argument is also a String, for the value of this parameter. This means even for numerics or booleans, you should cast them in to String.
e.g. "true", "0".
Here is an example that may help you know how to set and retrieve parameters: