version 1
CT Get object type (area; scope) Integer
| Parameter | Type | Description | |
| area | Longint | 4D Chart area | |
| scope | Longint | Scope of the function | |
| -1 = All | |||
| 0 = Selected objects | |||
| >0 = Object ID | |||
| Function result | Integer | Object type of the objects in area |
Description
CT Get object type returns the object type for the object(s) in area described by scope.
An object's type is described by an integer code which cannot be changed once an object is created.
If scope equals -1, CT Get object type returns the object type for all objects in the document. If the types of the objects are not equal, CT Get object type returns -32000.
If scope equals 0, CT Get object type returns the object type for the selected objects. If the types of the objects are not equal, CT Get object type returns -32000.
If scope is greater than 0, it must be equal to a specific object's ID and that object's type is returned. If the object does not exist, CT Get object type returns -32000.
The following table lists all object codes:
| Code | Object Type |
| 1 | Text |
| 2 | not used |
| 3 | Picture |
| 4 | not used |
| 5 | Chart |
| 6 | Rectangle |
| 7 | Polygon |
| 8 | Oval |
| 9 | not used |
| 10 | Line |
| 11 | Group |
Example
This example returns the ID of the selected object in the $ID variable.
$ID:=CT Get object type (Area;0)
See Also