Adding Dynamic Properties to a Property Manager

To use a dynamic property for drawing objects, you must register it with the Property Manager for the intended AcRxClass. This makes it visible to the Property Inspector. The appropriate Property Manager can be obtained from an entity of the desired type by using the GET_AUTOMATION_PROTOCOL macro, as demonstrated by the following pseudo-code:

AcDbMyEnt* pEnt = new AcDbMyEnt();
CMyDynProp* pMyDynProp = new CMyDynProp();
IUnknown* pUnk;
hr = pMyDynProp->QueryInterface(IID_IUnknown, (void**)&pUnk);
if (SUCCEEDED(hr))
GET_AUTOMATION_PROTOCOL(pEnt)->GetPropertyManager()->
    AddProperty(pUnk);

Once your dynamic properties are added to the correct AcRxClass Property Manager, the Property Inspector displays your properties when it encounters objects of the associated AcRxClass.