|
发表于 2003-1-8 16:06:00
|
显示全部楼层
AcDbDictionary *pNamedobj;
acdbHostApplicationServices()->workingDatabase()->
getNamedObjectsDictionary(pNamedobj, AcDb::kForWrite);
AcDbDictionary *pDict;
Acad::ErrorStatus es;
if (pNamedobj->getAt("ZLDWGPROP_DICT", (AcDbObject*&) pDict,
AcDb::kForWrite) == Acad::eKeyNotFound)
{
pDict = new AcDbDictionary;
//以下为增加部分
AcDbObjectId DictId;
pNamedobj->setAt("ZLDWGPROP_DICT", pDict, DictId);
//没找到,就要创建并加入
}
pNamedobj->close();
if (pDict) {
//结束
// Create new objects to add to the new dictionary,
// add them, then close them.
//
AsdkMyClass *pObj2 = new AsdkMyClass(2);
AcDbObjectId rId1;
es = pDict->setAt("ROJECTNAME", pObj2, rId1);// 增加字典条目PROJECTNAME
//以下为增加部分
pObj2->close();
pDict->close();
//结束
}
|
|