PictureResourceComboBox

The value type PictureResourceComboBox s used to create a combo box for the input of an integer value. The value is entered by selecting an image from the combo box list.

../../../../_images/PictureResourceComboBox.png

Syntax

<Parameter>
<Name>PictureResourceComboBoxValue</Name>
<Text>PictureResourceComboBox|Value=0|Value=1|Value=2|Value=3</Text>
<Value>0</Value>
<ValueList>0|1|2|3</ValueList>
<ValueList2>16433|16441|16449|14563</ValueList2>
<ValueType>PictureResourceComboBox</ValueType>
</Parameter>

Additional info about the <Value> and <ValueList> tag are shown here Value and ValueList

The <Text> is used also for the additional item text. The text must be separated by the pipe | character, which must also be used for the text IDs in the <TextId> tag. The first text is the button text, the following texts are the additional texts for the list items.

The <ValueList2> tag is used to define the image entries of the combo box list. The values are IDs of Allplan internal image resources and must be separated by the pipe | character.

The <ValueList> tag defines the corresponding integer value for the image that will be assigned to the parameter after selecting the image. The values must be separated by the pipe | character.

The <Value> tag defines the value of the list item which will be selected by default.

Optional tags

If the PythonPart should be localized, the following tag must be added

<TextId>1001</TextId>

Sometimes it’s useful to disable or hide the combo box depending on the value of another parameter. This is achieved by adding additional tags to the parameter or by defining functions in the py-file. See Enable and visible options

The persistent state of the parameter can be changed by adding

<Persistent></Persistent>

Example

The implementation of the PictureResourceComboBox value type is described in the example ComboBox, which is located in

…\etc\Examples\PythonParts\PaletteExamples\ComboBox.pyp
…\etc\PythonPartsExampleScripts\PaletteExamples\ComboBox.py