version 6.0
DR ACTIVATE BIND (area; bindID; direction)
| Parameter | Type | Description | |
| area | Longint | 4D Draw area | |
| bindID | Longint | Bind ID | |
| direction | Integer | 1=Drawing ->Fields | |
| 2=Fields ->Drawing |
Description
The command DR ACTIVATE BIND associates the bind described by bindID with area.
bindID is the value returned by the DR New bind function.
A bind can work in either of two directions: drawing to fields, or fields to drawing. If the bind is activated in the drawing to fields direction, any changes to the selected objects in area result in changes to the bound fields. If a bind is activated in the fields to drawing direction, any changes to the bound fields result in corresponding changes to the attributes of selected objects in area.
The direction parameter controls what happens when the bind is activated. If direction equals 1, the bound fields are updated based on the selected objects. If direction equals 2, the objects are updated based on the bound fields. After the bind is activated, it will work in both directions.
You cannot delete a bind that is currently active, and you cannot have more than one bind in effect at one time for a given area. A bind stays active until deactivated or until the area is closed. To associate an area with a different bind, you must first deactivate the active bind using the DR DEACTIVATE BIND command.
Example
The following example shows how to build and activate a bind.
vBind := DR New bind DR ADD TO BIND (vBind;0;1;1) `Bind object ID to the first field DR ADD TO BIND (vBind;5;1;2) `Bind object width to second field DR ADD TO BIND (vBind;6;1;3) `Bind object height to the third field DR ADD TO BIND (vBind;11;1;4) `Bind object rotation to fourth field DR ACTIVATE BIND (Area;vBind;1) `Activate the bind
See Also