Basicshape: GetPosition

This gives the current position of the equipment.

Function

array GetPosition();

Parameters

None

Return Value

An array of 3 double values [x,y,z].

Example

var shape = GetComponentByNameAndType("BasicShape1", "Basic Shape");

function OnSimulationStart()
{
    Position();
}

function Position()
{
    // start animation
    shape.GoToPosition(7, 0, 0, 1, 0, 1, Noop, [1000, 800, 600, 400, 200]);
}

function Noop(sender, x, y, z)
{
    // get the current position and log it
    var pos = shape.GetPosition()
    LogDebug("X: " + pos[0] + " Y: " + pos[1] + " Z: " + pos[2])
}