Changes have been made to the graphics system (GS) which affect drawing objects in a viewport.
Supported platform: Windows only
Supported release(s): AutoCAD 2017 and later
The GS must now be referenced from the GS manager or by getting a message from an event handler, and no longer from the database or the drawable graphics interface. The following methods are obsolete and code statements using them most be updated:
If your program previously used AcDbDatabase::gsModel(), update your code to use the GS manager. The following code sample gets the GS model using the GS manager:
AcDbHostApplicationServices * pHAS = ::acdbHostApplicationServices(); AcadInternalServices *pAIS = pHAS->acadInternalServices(); AcGsManager* pMgr = pAIS ? pAIS->getAcGsManager() : nullptr; AcGsModel* pModel = pMgr ? pMgr->gsModel(db) : nullptr;
The hasGsModel of the GS manager returns a Boolean based on if the GS model is not null.
AcGsManager::hasGsModel()
If your program previously used the AcGiDrawable::gsNode() method to update an object, you must now utilize the callback system. The callback system consists of two different message handlers: AcGiDrawableReactor::modified() and AcGiDrawableReactor::erased(). You register or unregister to receive messages about graphics handling with the AcGiDrawableEvent::addReactor and AcGiDrawableEvent::removeReactor() methods.