version 6.0
DR ARRAY TO ATTRIBUTE (area; scope; attribute; array)
| Parameter | Type | Description | |
| area | Longint | 4D Draw area | |
| scope | Longint | -1=All | |
| 0=Selected | |||
| >0=Group ID | |||
| attribute | Longint | Attribute code | |
| array | Array | Source array |
Description
The command DR ARRAY TO ATTRIBUTE modifies attribute for each object in array, using a corresponding value. This command also applies to groupseach group is treated as a single object.
The object farthest in back in the stacking order corresponds to the first element in array.
If scope equals -1, the command applies array to all objects in the document that are not in a group.
If scope equals 0, the command applies array to the currently selected objects. A group is considered as a single object.
If scope is greater than 0, it must be the ID for a group; the command applies array to the objects inside the group. This last syntax lets you modify objects in a group without ungrouping.
DR ARRAY TO ATTRIBUTE modifies only the objects that have corresponding elements in the array and will not create objects if there are more elements in the array than objects. To determine the value needed, see the command that affects that attribute. For example, to determine how to specify a fill pattern, see DR SET FILL ATTRIBUTES.
DR ARRAY TO ATTRIBUTE modifies information on only one "level" of objects. To modify specific objects inside of a group, pass the group's ID as scope. Coordinate and size attributes are specified in base units. Use the DR ARRAY BASE TO SCALE command to convert an array of base units to scale units.
See Appendix A, Attribute Codes, for a complete list of attribute codes and corresponding array types. Note that several attributes cannot be modified.
Example
The following example searches for a selection of records that contain colors (Longints), fills an array with the colors, and applies those to the selected objects, provided there are not more selected objects than colors.
QUERY ([Colors];[Colors]Kind = "Standard")
SELECTION TO ARRAY ([Colors]Color;aColor)
If (DR Count (Area;0)<= Size of array (aColor))
DR ARRAY TO ATTRIBUTE (Area;0;13;aColor)
Else
ALERT("Too many objects selected!")
End if
See Also
DR ATTRIBUTE TO ARRAY, DR Get ID.