Hi, I have a normal pcell that you can give certain parameters. I want to check in this pcell if certain parameters are between a min and max value, and the reset the parameter to this value. How is this done?
For now i tried a if else statement.So I have parameter l, in the code body i check
if( l<minL then l = minL)
If I create an instance of this pcell, and enter a value lower as minL, this results in a pcell with correct l, only the value I initial entered is still visible in the instance parameters.
Can I change this?
This is a case where CDF callbacks can be used to good effect - the PCell parameter would have an associated CDF parameter, and this parameter would have a callback so that when the value is entered/changed on a form (Edit Object Properties, Add Instance) the value is checked within the boundaries that you set up; the CDF callback can modify (e.g. reset to min or max) the value to provide feedback to the user (along with a printed statement in the CIW, perhaps?)
Search for CDF callbacks if you need more help, or post follow-on questions here.
Hope this helps!