Populating the Property Arrays

To call the IPropertyInspector::Reset() method, you populate two arrays for use as the first two arguments. Elements in the first array represent objects whose properties are to be edited. If properties are defined in the IDL for an object in the first array, that object also serves as a static property source. Each element in the second array is a safe array of the property managers and property sources that are registered with the corresponding element in the first array.

In an AutoCAD context, the elements in the first array typically represent DWG objects or entities. However, these elements can actually be any ActiveX objects. In some cases, you may not want to edit properties of AutoCAD entities, but would like to use the Property Inspector instead to edit objects specific to your application. To edit static properties of non-AutoCAD objects, you merely need to wrap your objects in the IAcadBaseObject2 automation interface and add their IUnknown pointers to the array.

In certain cases, you may want to display properties and their options without relating them to a specific object. If this is your goal, you can populate the first array with a single null object. This object would be matched in the second array by a safe array containing pointers to the IUnknowns of property managers and property sources.

If your application intends to provide per-instance dynamic properties for groups of objects, you need to iterate through the object list and create a new dynamic property source for each entry. To provide properties for a selected object, the application registers an instance of its IPropertySource implementation as the property source for the currently selected objects. Registration is done by calling the following two macros:

These macros use the internal name of the property source to register it two ways. The first macro registers the new instance of the property source class in the per-instance property source dictionary. Thus, when AutoCAD looks up the handler for properties under this name, it will retrieve the current object. The second macro registers this property source name with the AcRx class associated with the selected object. This creates a link between the type of the underlying object and its property source name.