Networks of Actions

Actions are owned by AcDbAssocNetworks. The AcDbAssocNetwork itself is derived from AcDbAssocAction, therefore it behaves as an action and it is possible to create network hierarchies. The evaluate() method of a network collects all actions that need to be evaluated, and evaluates them in the correct order.

The network owns the actions in a "logical" sense but may also own them in a "physical" sense. The logical ownership means that the network knows about the action, and when the network is evaluated, it considers the action. When the action is also physically owned by the network, the network is the hard owner of the action so that the action is deep cloned when the network is deep or wblock cloned.

AcDbAssocNetwork Hierarchy

Applications should structure their actions based on the following recommendation. A database containing actions should have a single top level network attached to the AcDbDatabase. This network can be obtained (and also created if it does not exist yet) by calling the AcDbAssocNetwork::getInstanceFromDatabase() method. The top level network is owned by the Named Object Dictionary of the database under the default key "ACAD_ASSOCNETWORK". The AcDbAssocNetwork object is not owned directly, the Named Object Dictionary of the database owns a sub dictionary that is a soft owner of the actual AcDbAssocNetwork object.

The top level network may own other networks, and it can also own individual actions. The preferable arrangement is that the top level network for the whole database owns sub networks grouping actions that relate to the individual AcDbBlockTableRecords (BTRs). It may be the common Model Space and Paper Space AcDbBlockTableRecords, but also AcDbBlockTableRecords for the individual block definitions. These BTR networks are logically owned by the top level network but are physically owned by the extension dictionaries of the AcDbBlockTableRecords. The BTR networks can be obtained (and created if they do not exist yet) by calling the AcDbAssocNetwork::getInstanceFromObject() method. The way the network is owned by the extension dictionary of the AcDbBlockTableRecord is the same as the way the top level network is owned by the Named Object Dictionary of the database.The sub networks can own individual actions and other sub networks, depending on the application needs.