Parameter with a Python list¶
The value of the PythonPart parameter can be created as a Python list object of the used value type.
Syntax¶
<Parameter>
<Name>CubeDimensions</Name>
<Text> </Text>
<Value>[1000.,1200.,1400.,1600.,1800.]</Value>
<ValueType>Length</ValueType>
</Parameter>
For the definition of the list in the <Value> tag a general Python statement for list creation can be used
[]
[1000.,1200.,1400.,1600.,1800.]
[1000.] * 5
[[0 for x in range(3)] for y in range(5)]
…
By adding the list parameter to a Row and setting the value of the row to 1, the entire row can be used for the controls
Access to list row values¶
The special keyword $list_row allows access to values from a row in the tags <Visible>, <Enable>, <MinValue> and <MaxValue>.
Example¶
The implementation of the list value type is described in the example ListValues, which is located in
…\etc\Examples\PythonParts\PaletteExamples\ListValues.pyp
…\etc\PythonPartsExampleScripts\PaletteExamples\ListValues.py