MaterialButton¶
The value type MaterialButton is used to create a button for the selection of a material. After clicking the button, the dialog for material selection will be opened.
Syntax¶
<Parameter>
<Name>MaterialButton</Name>
<Text>MaterialButton</Text>
<Value>Glas</Value>
<ValueType>MaterialButton</ValueType>
</Parameter>
The entry for <Value> is the name of the Allplan surf file.
Optional tags¶
If the PythonPart should be localized, the following tag must be added
<TextId>1001</TextId>
An additional disable button can be added by using the tag
<DisableButtonIsShown>True</DisableButtonIsShown>
Clicking the button removes the input value for the material.
Sometimes it’s useful to disable or hide the material button 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 MaterialButton value type is described in the example MaterialButtons, which is located in
…\etc\Examples\PythonParts\PaletteExamples\MaterialButtons.pyp
…\etc\PythonPartsExampleScripts\PaletteExamples\MaterialButtons.py