本文整理汇总了C++中AcDbDictionary::objectId方法的典型用法代码示例。如果您正苦于以下问题:C++ AcDbDictionary::objectId方法的具体用法?C++ AcDbDictionary::objectId怎么用?C++ AcDbDictionary::objectId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AcDbDictionary
的用法示例。
在下文中一共展示了AcDbDictionary::objectId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getAppDictionary
AcDbObjectId OarxEmployeeService::getAppDictionary () {
AcDbDictionary *pNOD =NULL ;
AcDbDictionary *pFirmDict =NULL ;
AcDbDictionary *pAppDict =NULL ;
try {
//----- Get hold of the NOD
ARXOK ( getNOD (pNOD, AcDb::kForRead) ) ;
//----- Get our Firm Dictionary
AcDbObjectId id0 ;
if ( pNOD->getAt (OARX_FIRM_DICT, id0) == Acad::eKeyNotFound ) {
//----- Then create it
pFirmDict =new AcDbDictionary ;
if ( pFirmDict == NULL )
throw Acad::eOutOfMemory ;
ARXOK ( pNOD->upgradeOpen () ) ;
ARXOK ( pNOD->setAt (OARX_FIRM_DICT, pFirmDict, id0) ) ;
} else {
//----- Open the dictionary
ARXOK ( acdbOpenAcDbObject ((AcDbObject *&)pFirmDict, id0, AcDb::kForRead) ) ;
}
//----- Get our App Dictionary
if ( pFirmDict->getAt (OARX_APP_DICT, id0) == Acad::eKeyNotFound ) {
//----- Then create it
pAppDict =new AcDbDictionary ;
if ( pAppDict == NULL )
throw Acad::eOutOfMemory ;
if ( pFirmDict->isWriteEnabled () == false )
ARXOK ( pFirmDict->upgradeOpen () ) ;
ARXOK ( pFirmDict->setAt (OARX_APP_DICT, pAppDict, id0) ) ;
id0 =pAppDict->objectId () ;
}
pNOD->close () ;
pFirmDict->close () ;
pAppDict->close () ;
return (id0) ;
} catch (const Acad::ErrorStatus es) {
if ( pNOD != NULL )
pNOD->cancel () ;
if ( pFirmDict != NULL && pFirmDict->objectId () == AcDbObjectId::kNull )
delete pFirmDict ;
else if ( pFirmDict != NULL )
pFirmDict->cancel () ;
if ( pAppDict != NULL && pAppDict->objectId () == AcDbObjectId::kNull )
delete pAppDict ;
else
pAppDict->cancel () ;
return (AcDbObjectId::kNull) ;
}
}