Difference between revisions of "API Panel.Position.GetCoords"

From Flowcode Help
Jump to navigationJump to search
(XML import)
(XML import)
 
(9 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<sidebar>API contents</sidebar>
+
<sidebar>API Contents</sidebar>
Returns the positions coordinates in {X,Y,Z} array
+
Returns the positions coordinates in (X,Y,Z) array
  
 
<div style="width:25%; float:right" class="toc">
 
<div style="width:25%; float:right" class="toc">
Line 11: Line 11:
  
 
==Parameters==
 
==Parameters==
[[Variable types|HANDLE]] ''Handle''
+
[[Variable Types|HANDLE]] ''Handle''
 
:The position or component to read
 
:The position or component to read
 
:''The default value for this parameter is: '''''this'''
 
:''The default value for this parameter is: '''''this'''
  
[[Variable types|HANDLE]] ''Target''
+
[[Variable Types|HANDLE]] ''Target''
 
:The position or component to convert relative to
 
:The position or component to convert relative to
 
:''The default value for this parameter is: '''''this'''
 
:''The default value for this parameter is: '''''this'''
 +
  
 
==Return value==
 
==Return value==
[[Variable types|FLOAT[]]]
+
[[Variable Types|FLOAT[]]]
 +
 
 +
Returns the positions coordinates in (X,Y,Z) array
  
Returns the positions coordinates in {X,Y,Z} array
 
  
 
==Detailed description==
 
==Detailed description==
Line 33: Line 35:
 
* Add to a calculation icon: <pre class="brush:[cpp]">result = ::Panel.Position.GetCoords(handle, target)</pre>
 
* Add to a calculation icon: <pre class="brush:[cpp]">result = ::Panel.Position.GetCoords(handle, target)</pre>
  
''<span style="color:red;">No additional information</span>''
+
===Flowcode example file===
 +
Download {{Fcfile|SIMAPI_Panel_Position_GetCoords.fcfx|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.
 +
 
 +
 
 +
 
 +
[[File:SIMAPI_Panel_Position_GetCoords_Pic0.png|800px]]

Latest revision as of 15:57, 16 January 2014

<sidebar>API Contents</sidebar> Returns the positions coordinates in (X,Y,Z) array

Class hierarchy

Panel

Position
GetCoords

Parameters

HANDLE Handle

The position or component to read
The default value for this parameter is: this

HANDLE Target

The position or component to convert relative to
The default value for this parameter is: this


Return value

FLOAT[]

Returns the positions coordinates in (X,Y,Z) array


Detailed description

No additional information


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