Length

The value type Length is used to create an edit field for a length value that is displayed in the current Allplan length input unit.

../../../../_images/Length.png

Syntax

<Parameter>
<Name>LengthValue</Name>
<Text>Length</Text>
<Value>4711</Value>
<ValueType>Length</ValueType>
</Parameter>

Value unit

The unit for the default values assigned to <Value>, <MinValue>, <MaxValue> and <IntervalValue> is mm.

Optional tags

Additional info about the <Value> and the optional <ValueList> tag are shown here Value and ValueList

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>10000</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>100</IntervalValue>
An additional default value for an imperial unit can be set with the tag

<ImperialValue>4’6”</ImperialValue>

Depending on the active Allplan input unit, the default value from <Value> or <ImperialValue> will be used.

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

In some cases it’s useful to highlight input fields in the property palette, see Background color

The persistent state of the parameter can be changed by adding

<Persistent></Persistent>

Example

The implementation of the Length value type is described in the example AllControls, which is located in

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