Parameter with a dynamic attribute ID list

In Parameter with a dynamic attribute ID the value type AttributeIdValue is used to create an input control for a dynamic attribute value. Using this value type for a list allows to create a dynamic attribute list input.

<Parameter>
<Name>DynamicAttributeList</Name>
<Text>Attributes</Text>
<Value>[(0,)]<</Value>
<ValueType>AttributeIdValue</ValueType> <ValueDialog>AttributeSelectionInsert</ValueDialog>
</Parameter>
../../../../_images/DynamicListAttributeControls.png

Clicking to the button displayed to the right of the control can be used to

  • add a new attribute to the list

  • remove an attribute from the list

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

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 is described in the example files located in

…\etc\Examples\PythonParts\PaletteExamples\Attributes.pyp
…\etc\PythonPartsExampleScripts\PaletteExamples\Attributes.py
…\etc\Examples\PythonParts\ServiceExamples\ProjectAttributeService.pyp
…\etc\PythonPartsExampleScripts\ServiceExamples\ProjectAttributeService.py