version 6.0
DR Get rotation (area; scope) Integer
| Parameter | Type | Description | |
| area | Longint | 4D Draw area | |
| scope | Longint | -1=All | |
| 0=Selected | |||
| >0=Object ID | |||
| Function result | Integer | Rotation in degrees of the objects in area |
Description
The command DR Get rotation returns the rotation in degrees of the objects in area described by scope and has a range of 0 to 359°.
Rotation degrees are given counter-clockwise from 0°.
If scope equals -1, the function returns the rotation for all objects in the document.
If scope equals 0, the function returns the rotation for the selected objects. If the rotation is not the same for all of the objects described by scope, DR Get rotation returns -32000, and DR Error returns error number 29.
If scope is greater than 0, it must be equal to a specific object's ID; the function returns that object's rotation. If the object does not exist, DR Get rotation returns -32000, and DR Error returns error number 2.
Example
The following example checks to see if any objects in Area are rotated and, if any are rotated, sets them back to 0°.
If (DR Get rotation (Area;-1) = -32000) DR ROTATE (Area;-1;0;0) End if
See Also