Line2D

The value type Line2D is used to create the input controls for a 2D line

../../../../_images/Line2D.png

Syntax

<Parameter>
<Name>Line2DRow</Name>
<Text>_</Text>
<ValueType>Row</ValueType>

<Parameter>
<Name>DashedLine</Name>
<Text>Dashed line</Text>
<Value>Line2D(1000,1100,5000,1500)</Value>
<ValueType>Line2D</ValueType>
</Parameter>
</Parameter>

If each coordinate is to be displayed in a separate line, the syntax looks like this

<Parameter>
<Name>DashedLine</Name>
<Text>Dashed line</Text>
<Value>Line2D(1000,1100,5000,1500)</Value>
<ValueType>Line2D</ValueType>
</Parameter>

The result is

../../../../_images/Line2Dxy.png

Value unit

The unit for the default values assigned to the coordinate values in <Value> is mm.

Optional tags

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

<TextId>1001</TextId>

Sometimes it’s useful to disable or hide the edit fields 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 Line2D value type is described in the example GeometryElementsInput located in

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