version 6.0
DR GET FILL ATTRIBUTES (area; scope; pattern; color)
| Parameter | Type | Description | |
| area | Longint | 4D Draw area | |
| scope | Longint | -2=Default | |
| -1=All | |||
| 0=Selected | |||
| >0=ID | |||
| pattern | Integer | Pattern index | |
| color | Longint | Color value |
Description
The command DR GET FILL ATTRIBUTES returns into the pattern and color variables the fill attributes for the objects in area described by scope.
If scope equals -2, the command returns the default fill attributes.
If scope equals -1, the command returns the fill attributes for all objects in the document.
If scope equals 0, the command returns the fill attributes for the selected objects.
If scope is greater than 0, it must be equal to a specific object's ID, the command returns that object's attributes. If the object does not exist, DR GET FILL ATTRIBUTES returns -32000 for each attribute, and DR Error returns 2.
The codes for the scope parameter are given in the paragraph "Specifying the Scope of a Command" of the Manipulating Objects section.
pattern is the number of the pattern in the palette. Patterns have a value in the range 1 to 36 and are numbered left to right, top to bottom.
color is a long integer that represents the color of the object's interior. This number can be used in the commands DR SET FILL ATTRIBUTES and DR SET LINE ATTRIBUTES to set other objects to the same color.
If any of the attributes are not the same for all of the objects described by scope, DR GET FILL ATTRIBUTES returns -32000 for that attribute.
Example
The following example requests the user for an object's ID, checks to make sure the ID is valid, gets the object's fill pattern and color, and calls a project method that changes the pattern and color to emphasize the object.
$Temp := Num (Request ("Which object?";"1"))
`Get an objects ID number
If (OK=1) & ($Temp > 0)
`If they give a valid number
DR GET FILL ATTRIBUTES (Area;$Temp;vPattern;vColor)
`Get the fill attributes
If (vPattern # -32000)
`If the object exists
HIGHLIGHT (Area;$Temp;vPattern;vColor)
`Pass info to a project method
Else
`Otherwise
ALERT("There is no object with that ID!")
`Let the user know
End if
End if
See Also