数据库中的字典类,用户的自定义数据可以存放在字典中,它可以理解一个映射表,字符串是关键字,可以映射到任何一个对象。字典中可以再包含字典
class McDbDictionary : public McDbObject;
McDbDictionary.h
例如:输出字典中的所有数据
void CTestCommands::PrintDictionary(AcDbDictionary* pDict) { AcDbDictionaryIterator* pIter = pDict->newIterator(); if(pIter == NULL) return; for(;!pIter->done();pIter->next()) { AcDbObject* pObj = NULL; if(pIter->getObject(pObj,AcDb::kForRead) == Acad::eOk) { AcDbDictionary* pTemDict = AcDbDictionary::cast(pObj); AcDbXrecord* pTemXrecord = AcDbXrecord::cast(pObj); if(pTemDict != NULL) { PrintDictionary(pTemDict); } else if(pTemXrecord != NULL) { struct resbuf *pRbList; pTemXrecord->rbChain(&pRbList); printResbufChain(pRbList); acutRelRb(pRbList); } pObj->close(); } } delete pIter; }