"positionOnPath";
Describes any position on a polygon or pipe side.
Synopsis
getValue(string shape, "positionOnPath", float percent, int &x, int &y,
float &angle);
Parameters
Parameter | Description |
---|---|
shape | Name of the object |
percent | Specification of the distance of a position in percent from the starting point of a polygon or pipe side |
x | x value of the position |
y | y value of the position |
angle | Array that contains another array with pairs of coordinates |
Description
This attribute returns the position (x and y value), which is distant from the beginning of a polygon or pipe (the distance is specified with the parameter "percent" - in ratio to the overall length). Is percent==0 the starting point is returned, is percent==100 the end point is returned. Inputs below 0 are handled like 0, inputs over 100 are handled like 100.
Example
Displays the position, distant 80% from the starting point of the polygon, in the Log Viewer.
main()
{
shape pl=getShape("Polygon1");
float angle;
int x, y;
getValue(pl, "positionOnPath", 80, x, y, angle);
DebugN("x value: ", x, "y value: ", y, "Angle: ", angle);
}
Assignment
Polyline, Pipe