Skip to content


Parameter node

The node <Parameter> is used to define the parameter of the PythonPart, as well as the layout and controls of the property palette. The order of the <Parameter> nodes within <Page> node decides the order of the controls in the tab control of the property palette. Here is a basic example of a parameter:

    <Text>Integer parameter</Text>
  1. Depending on the required control type for the input of the parameter value, a corresponding value type must be set. Please refer to the subchapters to learn, what types of controls are available.


For the full list of tags, which can be included under <Parameter> with their explanation please refer to the chapter all tags.

Address the parameter value in script

For each parameter, an object of type ParameterProperty is being created and stored as a property in the BuildingElement object. This again is being passed as an argument to the functions build in the script (learn more about them here or here). The name of the property is the same, as the parameter name.


Let's assume we defined a parameter Integer in the .pyp file, just as in the example above. When a PythonPart is started, the create_element function is called and the BuildingElement object is passed to it by the PythonPart framework. The parameter value can be addressed within this function as follows:

def create_element(build_ele: BuildingElement, #(1)!
                   doc: AllplanElementAdapter.DocumentAdapter):

    my_integer = build_ele.Integer.value #(2)!
    print("The value of the integer parameter is: " + str(my_integer))
  1. This object holds our parameter in a property named the same as the parameter, so calling build_ele.Integer will get us the parameter as ParameterProperty object.
  2. To get the value, we simply must refer to the value property of the ParameterProperty object
Result in Allplan trace window
The value of the integer parameter is: 123


The text that appears in the property palette (<Text>), as well as the default value of a parameter (<Value>) can both be localized by supplying the tags <TextId> and <ValueTextId> respectively.

    <Text>String parameter</Text>
    <Value>This is a string</Value>
  1. Of course localizing the default value only makes sense in case of a string parameter

Please refer to the chapter string resources to learn more about how to build the .xml file for localizing a PythonPart.

Show the same parameter on multiple pages

A <Parameter> with the same name and values can occur on multiple pages inside the pyp-file. This makes it possible to have a control for a parameter on different pages within the property palette.


An example of using a parameter on multiple pages is shown in AllControls

  • …\etc\Examples\PythonParts\PaletteExamples\AllControls.pyp
  • …\etc\PythonPartsExampleScripts\PaletteExamples\

Set up the size

If a control is in a row, the height and width can be defined by the optional tags <HeightInRow> and <WidthInRow>. The values must be provided in pixels. The size values can be used, for example, to make the image in a button control more visible.

Control size

Set up the text style

The style of the text displayed on the left side can be controlled with the tag <FontFaceCode>

Option Description
0 normal
1 bold
2 italic
4 underline
    <Text>Integer parameter</Text>

Text style


Using the optional tag <Persistent> it is possible to control the persistency of the parameter. This means, whether the parameter should be stored in the favorite file (.pyv file) and/or in the model in the PythonPart itself.

Setting Description
No No persistent parameter
ModelAndFavorite The parameter is stored in the PythonPart as well as in the favorite file
Model The parameter is stored only in the PythonPart
Favorite The parameter is stored only in the favorites file
    <Text>Integer parameter</Text>