API Component.Clone: Difference between revisions
Appearance
No edit summary |
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead"" |
||
| (26 intermediate revisions by 4 users not shown) | |||
| Line 1: | Line 1: | ||
{| class="mtx-class-macrotable wikitable" | |||
== | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | |||
| width="90%" class="mtx-class-macrohead" | '''Clone''' | |||
|- | |||
| colspan="2" | Clones an existing object to another position on the panel | |||
|- | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-h32-icon.png]] - HANDLE | |||
| width="90%" | Source | |||
|- | |||
| colspan="2" | The object to copy | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-h32-icon.png]] - HANDLE | |||
| width="90%" | DestParent | |||
|- | |||
| colspan="2" | The parent to link the cloned object to | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-h32-icon.png]] - HANDLE | |||
| width="90%" | NewPosition | |||
|- | |||
| colspan="2" | A position to move the object to | |||
|- | |||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-h32-icon.png]] - HANDLE | |||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | |||
|} | |||
== | ==Detailed description== | ||
This creates an identical copy of the object which may be inserted at any point in the component tree. | |||
The root object may not be cloned, but other to that any object (even a [[API Component.GetOriginal|definition]]) may be cloned. | |||
==Examples== | |||
===Calling in a calculation=== | |||
* Declare a variable 'result' of type HANDLE | * Declare a variable 'result' of type HANDLE | ||
* Add to a calculation icon: result = ::Component.Clone(source, destparent, newposition) | * Add to a calculation icon: <pre class="brush:[cpp]">result = ::Component.Clone(source, destparent, newposition)</pre> | ||
Latest revision as of 14:11, 13 July 2026
Detailed description
This creates an identical copy of the object which may be inserted at any point in the component tree.
The root object may not be cloned, but other to that any object (even a definition) may be cloned.
Examples
Calling in a calculation
- Declare a variable 'result' of type HANDLE
- Add to a calculation icon:
result = ::Component.Clone(source, destparent, newposition)