当前位置: 首页>>代码示例>>C++>>正文


C++ AcDbDatabase::getNamedObjectsDictionary方法代码示例

本文整理汇总了C++中AcDbDatabase::getNamedObjectsDictionary方法的典型用法代码示例。如果您正苦于以下问题:C++ AcDbDatabase::getNamedObjectsDictionary方法的具体用法?C++ AcDbDatabase::getNamedObjectsDictionary怎么用?C++ AcDbDatabase::getNamedObjectsDictionary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AcDbDatabase的用法示例。


在下文中一共展示了AcDbDatabase::getNamedObjectsDictionary方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CreateSubDictionaryID

Acad::ErrorStatus CTwArxDictionary::CreateSubDictionaryID( IN const AcDbObjectId& IdRoot, IN const CString& strKey, OUT AcDbObjectId& IdSubDic, IN AcRxClass* pRxObjType /*= AcDbDictionary::desc() */ ) const
{
	if( pRxObjType == NULL ) return Acad::eNullObjectPointer;

	Acad::ErrorStatus es = Acad::eOk;
	AcDbDictionary* pDicRoot = NULL;
	AcDbDatabase* pWdb = acdbCurDwg();

	if( IdRoot.isNull() )
		es = pWdb->getNamedObjectsDictionary( pDicRoot, AcDb::kForRead );
	else
		es = acdbOpenObject( pDicRoot, IdRoot, AcDb::kForRead );

	if( es != Acad::eOk ) return es;

	if( pDicRoot->has(strKey) )
	{
		pDicRoot->getAt( strKey, IdSubDic );
		pDicRoot->close();
		return es;
	}

	pDicRoot->upgradeOpen();
	AcDbObject* pObj = (AcDbObject*)pRxObjType->create();
	es = pDicRoot->setAt( strKey, pObj, IdSubDic );
	pObj->close();
	pDicRoot->close();

	return es;
}
开发者ID:jiangnanemail,项目名称:WorkingDB,代码行数:30,代码来源:TWArxTool.cpp

示例2: GetSubDictionaryID

Acad::ErrorStatus CTwArxDictionary::GetSubDictionaryID( IN const AcDbObjectId& IdRoot, IN const CString& strKey, AcDbObjectId& IdSub, AcDbDatabase* pCurDB ) const
{
	Acad::ErrorStatus es = Acad::eOk;
	AcDbDictionary* pDicRoot = NULL;
	AcDbDatabase* pWdb = pCurDB;
	if( pWdb == NULL )
		pWdb = acdbCurDwg();
	if( IdRoot.isNull() )
		es = pWdb->getNamedObjectsDictionary( pDicRoot, AcDb::kForRead );
	else
		es = acdbOpenObject( pDicRoot, IdRoot, AcDb::kForRead );
	if( pDicRoot == NULL ) return es;
	pDicRoot->close();
	
	es = pDicRoot->getAt( strKey, IdSub );

	return es;

}
开发者ID:jiangnanemail,项目名称:WorkingDB,代码行数:19,代码来源:TWArxTool.cpp

示例3: acdbHostApplicationServices

void
createObjs()
{
    AcDbObjectId objIdA, objIdB, objIdC;
    AcDbDictionary *pNamedobj;
    AcDbDictionary *pDict = NULL;
    AcDbDatabase *pCurDwg = acdbHostApplicationServices()->workingDatabase();

    // Create object C with a dummy integer data value of 3.
    //
    AsdkOwnerDemo *pObjC = new AsdkOwnerDemo(3);

    // Append object C to database without setting an owner.
    //
    pCurDwg->addAcDbObject(objIdC, pObjC);

    pObjC->close();

    // Create object B with a dummy integer data value of 2.
    //
    AsdkOwnerDemo *pObjB = new AsdkOwnerDemo(2);

    // Append object B to the database without setting an owner.
    //
    pCurDwg->addAcDbObject(objIdB, pObjB);

    // Now set up ownership for object C.  The
    // AsdkOwnerDemo::setIdData() function takes the
    // objectId parameter and copies it into the
    // AcDbHardOwnershipId data member.  This places the
    // object ID in a position to be filed out/in via the
    // dwgInFields/dwgOutFields/dxfInFields/dxfOutFields
    // member functions.  This constitutes primary
    // "ownership."  The AsdkOwnerDemo::setIdData() function
    // also calls each owned object's setOwnerId() member
    // function to set the backpointer and establish the
    // full two-way ownership link.
    //
    pObjB->setIdData(objIdC);

    pObjB->close();

    // Create object A with a dummy integer data value of 1.
    //
    AsdkOwnerDemo *pObjA = new AsdkOwnerDemo(1);

    // Next, add objA to a dictionary in the named object
    // dictionary.  This will establish ownership for objA,
    // set the ownership backlink, and add it to the
    // database.
    //
    pCurDwg->getNamedObjectsDictionary(pNamedobj,
                                       AcDb::kForWrite);

    // Get a pointer to the ASDK_DICT dictionary.  If it
    // doesn't exist, then create it and add it to the
    // named object dictionary.
    //
    if (pNamedobj->getAt("ASDK_DICT", (AcDbObject*&) pDict,
                         AcDb::kForWrite) == Acad::eKeyNotFound)
    {
        pDict = new AcDbDictionary;
        AcDbObjectId DictId;
        pNamedobj->setAt("ASDK_DICT", pDict, DictId);
    }
    pNamedobj->close();

    // add object A to the ASDK_DICT dictionary
    //
    pDict->setAt("OBJA", pObjA, objIdA);
    pDict->close();

    // Now set up ownership for object B.
    //
    pObjA->setIdData(objIdB);

    pObjA->close();
}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:78,代码来源:ownrshp.cpp


注:本文中的AcDbDatabase::getNamedObjectsDictionary方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。