API Panel.Position.GetCoords

From Flowcode Help
Jump to navigationJump to search
Fc9-comp-macro.png GetCoords
Returns the positions coordinates in (X,Y,Z) array 
Fc9-h32-icon.png - HANDLE Handle
The position or component to read 
Fc9-h32-icon.png - HANDLE Target
The position or component to convert relative to 
Fc9-f32-icon.png - FLOAT[] Return


Detailed description

Examples

Calling in a calculation

  • Declare a variable 'result' of type FLOAT[]
  • Add to a calculation icon:
    result = ::Panel.Position.GetCoords(handle, target)

Flowcode example file

Download FC6 Icon.png SIMAPI_Panel_Position_GetCoords and open it in Flowcode v6. In this example a sphere and a LCD are shown on the system panel. When the program starts, the position of the sphere is returned into an existing Float Array variable containing the X,Y,Z coordinates. The coordinates are then displayed on the LCD display. Be aware in this example the LCD display is showing integer values. The floats are cast to ints. The screenshots below show the effect and also highlight the code used by the example.


SIMAPI Panel Position GetCoords Pic0.png