Events: an Overview


The goal of the MSBN3 events interface is to allow objects (ActiveX controls, VB forms, etc.) to precisely monitor MSBN3 editing with very little additional code. Toward this end, the events correspond to well-defined primitives. For example, there is no "Load Model" event. Rather, loading a model generates a series of primitive events like "ModelNodesAdd(aNode)" and "NodeParentNodesAdd(nodeChild, nodeParent)". Moreover, when you receive the "ModelNodesAdd" event, you are promised that node does have a name and description, but does not have any parents or properties. Likewise, when you receive an event that a node is to be removed, you are promised that it does not have any parents or properties.

These promises are detailed in the event documentation.

 

With few exceptions, you will receive an event after the editing action has occurred. If an action will destroy an object, then the event is fired before the action so that the object can be queried. Examples of events that fire before actions are "ModelNodesRemove(aNode)" and "ModelsRemove(aModel)".

 

The events make heavy use of passing objects. In all cases (because of the requirements of Visual Basic) these are of the generic object type "IDispatch *".