version 1
CT Get ID (area; scope; index) Longint
| Parameter | Type | Description | |
| area | Longint | 4D Chart area | |
| scope | Longint | Scope of the function | |
| -1 = All | |||
| 0 = Selected objects | |||
| >0 = Group ID | |||
| index | Longint | Number of object in scope | |
| Function result | Longint | The object's unique Object ID |
Description
CT Get ID returns the unique ID for the object in area described by scope and index. This number is used by many other 4D Chart commands and is referred to as an object's ID.
To get an object's ID, you first specify which set of objects to refer to and then the order of the object within the set. Objects are ordered from back to front. The backmost object has an index of 1.
If scope equals -1, then index refers to the order of the object within the entire document.
If scope equals 0, then index refers to the order of the object within the currently selected objects.
If scope is greater than 0, it must be the ID for a group and index refers to the order of objects within the group. This last syntax lets you manipulate objects in a group without ungrouping.
Example
This example shows how to extract the ID for a selected object.
vID := CT Get ID (Area;0;1) `Get the ID of the first selected object