Skip to content

Geometry

The parameter with the geometry value types can be used to create input controls for the geometry elements like point, line or spline. Although the input controls are the same, as e.g., for <Valuetype> Length, the value of the parameter represents an actual geometry object from the module NemAll_Python_Geometry.

Value types

Point

Defining <ValueType> as Point2D creates a parameter that returns a Point2D object as a result value.

Parameter Point2D

<Parameter>
    <Name>Point2</Name>
    <Text>Center</Text>
    <Value>Point2D(1000,500)</Value>
    <ValueType>Point2D</ValueType>
</Parameter>

Defining <ValueType> as Point3D creates a parameter that returns a Point3D object as a result value.

Parameter Point3D

<Parameter>
    <Name>Point1</Name>
    <Text>Point 1</Text>
    <Value>Point3D(0,0,0)</Value>
    <ValueType>Point3D</ValueType>
</Parameter>

Vector

Defining <ValueType> as Vector2D creates a parameter that returns a Vector2D object as a result value.

Parameter Vector2D

<Parameter>
    <Name>Vector2</Name>
    <Text>Direction</Text>
    <Value>Vector2D(2000,200)</Value>
    <ValueType>Vector2D</ValueType>
</Parameter>

Defining <ValueType> as Vector3D creates a parameter that returns a Vector3D object as a result value.

Parameter Vector3D

<Parameter>
    <Name>Vector3</Name>
    <Text>Direction</Text>
    <Value>Vector3D(2000,200,1000)</Value>
    <ValueType>Vector3D</ValueType>
</Parameter>

Arc

Defining <ValueType> as Arc2D creates a parameter that returns an Arc2D object as a result value.

Parameter Arc2D

<Parameter>
    <Name>Arc2</Name>
    <Text>Arc</Text>
    <Value>Arc2D(CenterPoint(7000, 0) MinorRadius(1000) MajorRadius(2000) AxisAngle(0.78539816339744828) StartAngle(0.78539816339744828) EndAngle(4.7123889803846897) IsCounterClockwise(1))</Value>
    <ValueType>Arc2D</ValueType>
</Parameter>

Defining <ValueType> as Arc3D creates a parameter that returns an Arc3D object as a result value.

Parameter Arc3D

<Parameter>
    <Name>Arc3</Name>
    <Text>Arc</Text>
    <Value>Arc3D(CenterPoint(7000, 5000, 1000) XDirection(1, 0, 0) ZAxis(0, 0, 1) MinorRadius(1000) MajorRadius(2000) AxisAngle(0.78539816339744828) StartAngle(0.78539816339744828) EndAngle(4.7123889803846897) IsCounterClockwise(1))</Value>
    <ValueType>Arc3D</ValueType>
</Parameter>

Circle

Defining <ValueType> as Circle2D creates a parameter that also returns an Arc2D object as a result value, but with DeltaAngle set to 360°.

Parameter Circle2D

<Parameter>
    <Name>Circle3</Name>
    <Text>Circle</Text>
    <Value>Circle2D(CenterPoint(10000, 0)MajorRadius(1000))</Value>
    <ValueType>Circle2D</ValueType>
</Parameter>

Defining <ValueType> as Circle3D creates a parameter that returns an Arc3D object as a result value, but with DeltaAngle set to 360°.

Parameter Circle3D

<Parameter>
    <Name>Circle3</Name>
    <Text>Circle</Text>
    <Value>Circle3D(CenterPoint(10000, 5000, 1000) ZAxis(0, 0, 1) MajorRadius(1000))</Value>
    <ValueType>Circle3D</ValueType>
</Parameter>

Line

Defining <ValueType> as Line2D creates a parameter that returns a Line2D object as a result value

Parameter Line2D

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

Defining <ValueType> as Line3D creates a parameter that returns a Line3D object as a result value

Parameter Line3D

<Parameter>
    <Name>Line3</Name>
    <Text>Line</Text>
    <Value>Line3D(1000,6100,0,5000,6500,1000)</Value>
    <ValueType>Line3D</ValueType>
</Parameter>

Polyline

Defining <ValueType> as Polyline2D creates a parameter that returns a Polyline2D object as a result value

Parameter Polyline2D

<Parameter>
    <Name>Polyline2</Name>
    <Text>Point</Text>
    <Value>Polyline2D(Points((2000,2000)(3000,3100)(4000,3500)))</Value>
    <ValueType>Polyline2D</ValueType>
</Parameter>

Defining <ValueType> as Polyline3D creates a parameter that returns a Polyline3D object as a result value

Parameter Polyline3D

<Parameter>
    <Name>Polyline3</Name>
    <Text>Point</Text>
    <Value>Polyline3D(Points((2000,7000,0)(3000,8100,1000)(4000,8500,3000)))</Value>
    <ValueType>Polyline3D</ValueType>
</Parameter>

Polygon

Defining <ValueType> as Polygon2D creates a parameter that returns a Polygon2D object as a result value

Parameter Polygon2D

<Parameter>
    <Name>Polygon2</Name>
    <Text>Point</Text>
    <Value>Polygon2D(Points((5000,2000)(6000,3100)(5000,3500)(5000,2000)))</Value>
    <ValueType>Polygon2D</ValueType>
</Parameter>

Defining <ValueType> as Polygon3D creates a parameter that returns a Polygon3D object as a result value

Parameter Polygon3D

<Parameter>
    <Name>Polygon3</Name>
    <Text>Point</Text>
    <Value>Polygon3D(Points((5000,7000,0)(6000,8100,1000)(5000,8500,3000)(5000,7000,0)))</Value>
    <ValueType>Polygon3D</ValueType>
</Parameter>

Spline

Defining <ValueType> as Spline2D creates a parameter that returns a Spline2D object as a result value

Parameter Spline2D

<Parameter>
    <Name>Spline2</Name>
    <Text>Point</Text>
    <Value>Spline2D(StartVector(1, 1)EndVector(1, 1)Points((7000,2000)(8000,3100)(10000,3500)))</Value>
    <ValueType>Spline2D</ValueType>
</Parameter>

Defining <ValueType> as Spline3D creates a parameter that returns a Spline3D object as a result value

Parameter Spline3D

<Parameter>
    <Name>Spline3</Name>
    <Text>Point</Text>
    <Value>Spline3D(StartVector(1, 1, 1)EndVector(1, 1, 1)Points((7000,7000,0)(8000,8100,1000)(10000,8500,3000)))</Value>
    <ValueType>Spline3D</ValueType>
</Parameter>

BSpline3D

Defining <ValueType> as BSpline3D creates a parameter that returns a BSpline3D object as a result value

Parameter BSpline3D

<Parameter>
    <Name>BSpline3</Name>
    <Text>Point</Text>
    <Value>BSpline3D(IsPeriodic(0)Degree(3)Weights()Knots(0,0,0,0,1,1,1,1)Points((12000,7000,0)(13000,9100,1000)(15000,6000,3000)(18000,9000,0)))</Value>
    <ValueType>BSpline3D</ValueType>
</Parameter>

Coordinates in one row

If a geometry object requires a point or a vector (2D or 3D) to be specified, the coordinates for it can be displayed in the palette in two ways:

This is the default way, how point coordinates will be displayed in the palette.

Parameter Point3D

<Parameter>
    <Name>Point1</Name>
    <Text>Point 1</Text>
    <Value>Point3D(0,0,0)</Value>
    <ValueType>Point3D</ValueType>
</Parameter>

However, using the tag <XYZinRow> it is also possible to display all the coordinates in one row, like this:

Parameter Point3D in one row

<Parameter>
    <Name>Point2</Name>
    <Text>Point 2</Text>
    <Value>Point3D(1000,1000,0)</Value>
    <ValueType>Point3D</ValueType>
    <XYZinRow>True</XYZinRow>
</Parameter>

Individual text for each coorinate

When for each of the x,y and z coordinates an individual text in the palette has to be set, this can be achieved by defining all the texts in the <Text> tag, seperated with a coma.

Parameter Point3D with individual text

<Parameter>
    <Name>RefPoint</Name>
    <Text>From left,From front,From bottom</Text>
    <Value>Point3D(1000,2000,3000)</Value>
    <ValueType>Point3D</ValueType>
</Parameter>

Hide or disable a control

When a geometry parameter has to be disabled or hidden, this can be achieved with the tags <Visible> and <Enable> as described in this chapter. However, if only a single component of the geometry parameter needs to be hidden or disabled (e.g., a ), it can be achieved by introducing | character in the tag.

Parameter Point3D with hidden coordinate

<Parameter>
    <Name>StartPoint</Name>
    <Text>Start point</Text>
    <Value>Point3D(5000,1000,0)</Value>
    <ValueType>Point3D</ValueType>
    <Visible>|StartPoint.Y:False<!--(1)!--></Visible>
</Parameter>
  1. This will hide the Y component of the point in the palette.

Example

The implementation of all geometrical value types is shown in the examples located in:

…\etc\Examples\PythonParts\PaletteExamples\GeometryElements\