Implementing IDynamicProperty2 Methods

To implement dynamic properties, you define a new class based on IDynamicProperty2. This class represents your property and handles its data value, its appearance, and its description. You must generate a new GUID to identify your property, and implement the IDynamicProperty2::GetGUID() method to return your generated value.

The GetCurrentValueData() and SetCurrentValueData() methods are your property's primary accessors. The Property Inspector passes in an IUnknown pointer that identifies the object being queried. This identification is necessary because your dynamic property is attached to an AcRxClass, rather than to a drawing object. If necessary, you can use this pointer to gather information about the object before setting or returning the property's value.

You are required to implement the GetDisplayName() method to define the name that the Property Inspector displays for your property. You also may choose to define the GetDescription() method to display extra information about your property in the Property Inspector's status bar.

The GetCurrentValueName() method may be implemented to specify that your dynamic property should be edited with one of the standard AutoCAD editing controls. To use this method, you return a predefined string that indicates which control suits your property's data. The Property Inspector tries to call this method when it is displaying your property. If the method is implemented, the Property Inspector instantiates the indicated control when it displays your property. See the ObjectARX Reference for the list of currently supported strings that may be passed to this method.