Dynamic minimal and maximal value¶
The range of the minimal and/or maximal input value can be set by adding the tags:
<MinValue>xxx</MinValue>
<MaxValue>yyy</MaxValue>
The <MinValue> and <MaxValue> tag can contain conditions to create a dynamic minimal and/or maximal value. There are two ways to achieve this
use a conditional expression
<MinValue>0 if WithOutBorder else 100</MinValue>
write a multi line Python expression
<MaxValue> if WithOutBorder: return 0 else: return 100 </MaxValue>
The expression must be written as Python code, functions from the math package are possible and can be used by math.xxx.
The use of the dynamic minimal and maximal values are shown in the following example
…\etc\Examples\PythonParts\PaletteExamples\AllControls.pyp…\etc\PythonPartsExampleScripts\PaletteExamples\AllControls.py