AcDbDictionary *pNamedobj;
acdbHostApplicationServices()->workingDatabase()->getNamedObjectsDictionary(pNamedobj, AcDb::kForWrite);
// Check to see if the dictionary we want to create is
// already present. If not, create it and add
// it to the named object dictionary.
//
AcDbDictionary *pDict;
if (pNamedobj->getAt(_T("ASDK_DICT"), (AcDbObject*&) pDict, AcDb::kForWrite) == Acad::eKeyNotFound)
{
pDict = new AcDbDictionary;
AcDbObjectId DictId;
pNamedobj->setAt(_T("ASDK_DICT"), pDict, DictId);
}
pNamedobj->close();
if (pDict) {
// Create new objects to add to the new dictionary,
// add them, then close them.
//
AsdkMyClass *pObj1 = new AsdkMyClass(1);
AsdkMyClass *pObj2 = new AsdkMyClass(2);
AcDbObjectId rId1, rId2;
pDict->setAt(_T("OBJ1"), pObj1, rId1);
pDict->setAt(_T("OBJ2"), pObj2, rId2);
pObj1->close();
pObj2->close();
pDict->close();
}