Parameter with a dynamic attribute ID

The value type AttributeIdValue is used to create an input control for a dynamic attribute value.

../../../../_images/DynamicAttributeControls.png

Clicking to the button displayed to the right of the control opens the Attribute dialog. When the attribute is selected, the input control for the attribute in the property palette is created automatically using the defined control type of the attribute. The attribute text is displayed to the left of the control.

Syntax

<Parameter>
<Name>AttributeID</Name>
<Text>All attributes ID</Text>
<Value>A1</Value>
<ValueType>AttributeIdValue</ValueType> <ValueDialog>AttributeSelection</ValueDialog>
</Parameter>

With the assigned value dialog, see Attribute dialog, the selectable attributes can be limited.

The value type AttributeIdValue can be used to create a dynamic attribute list input, see Parameter with a dynamic attribute ID list

Optional tags

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

<TextId>1001</TextId>
The range of the minimal and/or maximal input value can be set by adding the tags:

<MinValue>0</MinValue>
<MaxValue>100</MaxValue>

More information are shown in Dynamic minimal and maximal value

If the input should be done by a slider, the following tags must be used:

<ValueSlider>True</ValueSlider>
<IntervalValue>5</IntervalValue>

Sometimes it’s useful to disable or hide the edit field 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 AttributeIdValue value type is described in the example AllControls, which is located in

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