More About Components
In Chapter 4 we begin to examine AutoCAD's object model in detail, working our way from the Application object on down. First, however, we need to complete the picture of how AutoCAD fits into the overall COM structure. We conclude this chapter by introducing the tables of object methods and properties (and events) that conclude half the chapters in this book.
As we mentioned earlier, all AutoCAD objects inherit from Idispatch, with the exception of IAcadObjectEvents, which inherits directly from IUnknown. IAcadObjectEvents is the event interface for AutoCAD entities, which occurs whenever an object is modified (the Modified event). There are two other interfaces in the AutoCAD type library that handle events: _DAcadApplicationEvents and _DAcadDocumentEvents. These are the event interfaces for AcadApplication and ThisDrawing. They are called dispinterfaces, which means that they define a set of methods and properties (not in the vtable for the object) that invoke a response to designated events. (In Chapter 13 we explore AutoCAD events in detail.)
IAcadIdPair and IAcadState
The IAcadState interface supports a special object (AcadState) that can be used to monitor the state of AutoCAD from out-of-process applications (i.e., VB). The IsQuiescent property or the GetAcadState method of the Application object can be used to check to see whether AutoCAD is idle and ready to accept automation calls. The IAcadIdPair interface, which returns information pertaining to the process of copying objects, is discussed in Chapter 12.
IAcadEntity and IAcadObject
Of particular interest to us in traversing AutoCAD's object model is the IAcadObject interface, which is the parent of just about everything else. All nongraphic objects are direct descendants of IAcadObject, as is IAcadEntity. All graphic objects descend from IAcadEntity, some, such as dimensions, through other intermediate classes of objects. We have included IAcadDimension in Figure 1-5 because it contains a unique set of dimensional entities. Blocks and BlockReferences are also major subclasses that can contain all of AutoCAD's entities. Blocks are the subject of Chapter 8, and Dimensions are covered in Chapter 11.
Figure 1-5 AutoCAD Inheritance