Jump to content

API Panel.Position.GetCoords: Difference between revisions

From Flowcode Help
Admin (talk | contribs)
XML import
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead""
 
(12 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<sidebar>API contents</sidebar>
{| class="mtx-class-macrotable wikitable"
Returns the positions coordinates in {X,Y,Z} array
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''GetCoords'''
|-
| colspan="2" | Returns the positions coordinates in (X,Y,Z) array&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-h32-icon.png]] - HANDLE
| width="90%" | Handle
|-
| colspan="2" | The position or component to read&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-h32-icon.png]] - HANDLE
| width="90%" | Target
|-
| colspan="2" | The position or component to convert relative to&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT[]
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}


<div style="width:25%; float:right" class="toc">
====Class hierarchy====
[[API Panel|Panel]]
:[[API Panel.Position|Position]]
::[[API Panel.Position|GetCoords]]
</div>
__TOC__


==Parameters==
==Detailed description==
[[Variable types|HANDLE]] ''Handle''
:The position or component to read
:''The default value for this parameter is: '''''this'''
 
[[Variable types|HANDLE]] ''Target''
:The position or component to convert relative to
:''The default value for this parameter is: '''''this'''
 
==Return value==
[[Variable types|FLOAT[]]]
 
Returns the positions coordinates in {X,Y,Z} array


==Detailed description==
''<span style="color:red;">No additional information</span>''




Line 33: Line 31:
* 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 14:11, 13 July 2026

GetCoords
Returns the positions coordinates in (X,Y,Z) array 
- HANDLE Handle
The position or component to read 
- HANDLE Target
The position or component to convert relative to 
- 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 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.