Skip to content

Combo box

Defining a parameter with a combo box means providing the user of the PythonPart a finite number of possible options to choose from. The <Value> tag defines the default value and the <ValueList> tag defines the possible values of the parameter, separated by | character.

Value types


Parameter String ComboBox



Parameter Integer ComboBox



Parameter Double ComboBox


Length 1

Parameter Length ComboBox


Angle 1

Parameter Angle ComboBox



With a PictureComboBox is used to create a combo box for the input of an integer value by selecting an image from the list.

The <ValueList2> is used to define the image entries of the combo box list. The values are .png file names with path specification.

Parameter Picture ComboBox

    <Text>Picture|Value=0|Value=1|Value=2</Text> <!--(1)!-->
    <Value>0</Value> <!--(2)!-->
    <ValueList>0|1|2|3</ValueList> <!--(3)!-->
  1. Here not only the text in the palette left to the combo box is defined, but also the text displayed next to the image. When localizing, remember to specify all corresponding <TextId>s as a list with | separator.
  2. The default value
  3. The corresponding integer value for the image that will be assigned to the parameter after selecting the image.

Picture resource

Just as the Picture ComboBox, but instead of providing a path to a .png file in <ValueList2>, we provide the IDs of Allplan internal image resources.

Parameter Picture Resource ComboBox


Dynamic value list

From python code

To generate the options dynamically, the tag <ValueList> can hold Python code, that creates a string with values separated with |, or a Python list. The Python source code for the condition must be left aligned. Functions from the math package are allowed (by calling

<ValueList>['Text'+str(value) for value in range(1, 4)]</ValueList> #(1)!
  1. This line of code will create a list like this: Parameter String ComboBox
    if HeightDimension == 1:
        return "Text1|Text2|Text3"
        return "Text4|Text5|Text6"

From enumeration

The values for the tag <ValueList> can be get from the key in enumeration classes, that already exists in the modules of Allplan Python API. This can be done with this line of code:

<ValueList>"|".join(str(key) for key in AllplanBaseEle.IFC_Version.names.keys())</ValueList>

Instead of full names of Allplan Python API modules, following keywords can be used:

Module full name Keyword
NemAll_Python_AllplanSettings AllplanSettings
NemAll_Python_BaseElements AllplanBaseEle
NemAll_Python_BasisElements AllplanBasisEle
NemAll_Python_Geometry AllplanGeo
NemAll_Python_IFW_Input AllplanIFW
NemAll_Python_Reinforcement AllplanReinf
NemAll_Python_Utility AllplanUtil


The text that appears in the property palette (<Text>), as well as the entries in the string combo box can both be localized by providing additional tags <TextId> and <ValueList_TextIds>



Check out the examples provided in:

  • …\etc\Examples\PythonParts\PaletteExamples\BasicControls\ComboBoxControls.pyp
  • …\etc\PythonPartsExampleScripts\PaletteExamples\BasicControls\

  1. Regarding units the same rules apply for a combo box as they apply for a normal edit control