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

From Flowcode Help
Jump to navigationJump to search
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<sidebar>API contents</sidebar>
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Moves the object to the given coordinates relative to its parent
+
|-
 
+
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
<div style="width:25%; float:right" class="toc">
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''MoveTo'''
====Class hierarchy====
+
|-
[[API Panel|Panel]]
+
| colspan="2" | Moves the object to the given coordinates relative to its parent&nbsp;
:[[API Panel.Position|Position]]
+
|-
::[[API Panel.Position|MoveTo]]
+
|-
</div>
+
| width="10%" align="center" | [[File:Fc9-h32-icon.png]] - HANDLE
__TOC__
+
| width="90%" | Handle
 
+
|-
==Parameters==
+
| colspan="2" | The position or component to update&nbsp;
[[Variable Types|HANDLE]] ''Handle''
+
|-
:The position or component to update
+
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
:''The default value for this parameter is: '''''this'''
+
| width="90%" | X
 
+
|-
[[Variable Types|FLOAT]] ''X''
+
| colspan="2" | Local coordinate X to update with&nbsp;
:Local coordinate X to update with
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
[[Variable Types|FLOAT]] ''Y''
+
| width="90%" | Y
:Local coordinate Y to update with
+
|-
 
+
| colspan="2" | Local coordinate Y to update with&nbsp;
[[Variable Types|FLOAT]] ''Z''
+
|-
:Local coordinate Z to update with
+
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
 
+
| width="90%" | Z
 
+
|-
==Return value==
+
| colspan="2" | Local coordinate Z to update with&nbsp;
''This call does not return a value''
+
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - NONE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
 
==Detailed description==
 
==Detailed description==
This moves a position to a set of absolute coordinates in its own coordinate space. That is, the center of the parent object is considered to be (0, 0, 0).
+
This moves a position to a set of absolute coordinates in its parents coordinate space. That is, the center of the parent object is considered to be (0, 0, 0).
  
  
This call is a compliment to [[Panel.Position.MoveBy|MoveBy]].
+
This call is a compliment to [[API Panel.Position.MoveBy|MoveBy]].
  
  
Line 42: Line 45:
  
 
===Flowcode example file===
 
===Flowcode example file===
Download [[File:SIMAPI_Panel_Position_MoveTo.fcf]] and open it in Flowcode v6. In this example, there are three cubiods that represent Axis X,Y,Z. Note they are coloured exactly as the panel axis indicator which represents your viewing position. There is a sphere also on the panel.  
+
Download {{Fcfile|SIMAPI_Panel_Position_MoveTo.fcfx|SIMAPI_Panel_Position_MoveTo}} and open it in Flowcode v6. In this example, there are three cubiods that represent Axis X,Y,Z. Note they are coloured exactly as the panel axis indicator which represents your viewing position. There is a sphere also on the panel.  
  
 
The MoveTo(h,x,y,z) function moves the object specified to a new set of coordinates. In the example file, the program moves the sphere from it's original location of x10,y10,z0 to x100,y75,z0, waits a second and then moves the sphere back to it's original coordinates.
 
The MoveTo(h,x,y,z) function moves the object specified to a new set of coordinates. In the example file, the program moves the sphere from it's original location of x10,y10,z0 to x100,y75,z0, waits a second and then moves the sphere back to it's original coordinates.

Latest revision as of 11:41, 16 January 2023

Fc9-comp-macro.png MoveTo
Moves the object to the given coordinates relative to its parent 
Fc9-h32-icon.png - HANDLE Handle
The position or component to update 
Fc9-f32-icon.png - FLOAT X
Local coordinate X to update with 
Fc9-f32-icon.png - FLOAT Y
Local coordinate Y to update with 
Fc9-f32-icon.png - FLOAT Z
Local coordinate Z to update with 
Fc9-void-icon.png - NONE Return


Detailed description

This moves a position to a set of absolute coordinates in its parents coordinate space. That is, the center of the parent object is considered to be (0, 0, 0).


This call is a compliment to MoveBy.


Examples

Calling in a calculation

  • Add to a calculation icon:
    ::Panel.Position.MoveTo(handle, x, y, z)


Flowcode example file

Download FC6 Icon.png SIMAPI_Panel_Position_MoveTo and open it in Flowcode v6. In this example, there are three cubiods that represent Axis X,Y,Z. Note they are coloured exactly as the panel axis indicator which represents your viewing position. There is a sphere also on the panel.

The MoveTo(h,x,y,z) function moves the object specified to a new set of coordinates. In the example file, the program moves the sphere from it's original location of x10,y10,z0 to x100,y75,z0, waits a second and then moves the sphere back to it's original coordinates.

The screenshots below show the effect and also highlight the code used by the example.

SIMAPI Panel Position MoveTo Pic1.pngSIMAPI Panel Position MoveTo Pic2.png SIMAPI Panel Position MoveTo Pic0.png