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


C++ AcDbObject::erase方法代码示例

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


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

示例1: mapIter

void
ArxDbgAppEditorReactor::verifyClonedReferences(AcDbIdMapping& idMap)
{
    ArxDbgDbEntity* ent;
    AcDbObject* obj;
    Acad::ErrorStatus es;
    int numErrorsFixed;

    AcDbIdPair idPair;
    AcDbIdMappingIter mapIter(idMap);
    for (mapIter.start(); !mapIter.done(); mapIter.next()) {
        if (mapIter.getMap(idPair)) {
            es = acdbOpenObject(obj, idPair.value(), AcDb::kForWrite);
            if (es == Acad::eOk) {
                ent = ArxDbgDbEntity::cast(obj);
				if (ent != NULL) {
					es = ent->verifyReferences(numErrorsFixed, true);
					if (es != Acad::eOk) {
						ASSERT(0);
						ArxDbgUtils::rxErrorMsg(es);
						obj->erase();   // don't know what else to do but erase screwed up entity
					}
				}
                obj->close();
            }
            else {
                ASSERT(0);
                ArxDbgUtils::rxErrorMsg(es);
            }
        }
        else {
            ASSERT(0);
        }
    }
}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:35,代码来源:ArxDbgAppEditorReactor.cpp

示例2: ARXOK

void
removeEntryFromDict(const char* strDictKey, AcDbDictionary* pParent, 
            const char* strEmpKey) 
{
    AcDbObjectId idO;
    //see if our dictionary is there
    ARXOK(pParent->getAt(strDictKey,idO));
    //get it for write 
    AcDbObject* pO;
    ARXOK(actrTransactionManager->getObject(pO,idO,AcDb::kForWrite));
    //check if someone has else has created an entry with our name
    //that is not a dictionary. This should never happen as long as
    //I use the registered developer ID.
    AcDbDictionary* pEmployeeDict;
    if ((pEmployeeDict=AcDbDictionary::cast(pO))==NULL)
        throw Acad::eNotThatKindOfClass;
    //check if a record with this key isthere
    ARXOK(pEmployeeDict->getAt(strEmpKey,idO));
    //get it for write 
    ARXOK(actrTransactionManager->getObject(pO,idO,AcDb::kForWrite));
    //and erase it
    ARXOK(pO->erase());
    //erase dictionary if it has no more entries
    if (pParent->numEntries()==0)
        ARXOK(pParent->erase());

}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:27,代码来源:Lab8CommandUtils.cpp

示例3:

void ArxEntityHelper::EraseObject2( const AcDbObjectId& objId, Adesk::Boolean erasing )
{
    AcDbObject* pObj;
    if( Acad::eOk == acdbOpenAcDbObject( pObj, objId, AcDb::kForWrite, !erasing ) )
    {
        pObj->erase( erasing );
        pObj->close();
        //acutPrintf(_T("\n使用Open/close机制删除对象成功"));
    }
}
开发者ID:kanbang,项目名称:TIDS,代码行数:10,代码来源:ArxEntityHelper.cpp

示例4: EraseObject

void ArxEntityHelper::EraseObject( const AcDbObjectId& objId, Adesk::Boolean erasing )
{
    AcTransaction* pTrans = actrTransactionManager->startTransaction();
    if( pTrans == 0 ) return;

    AcDbObject* pObj;
    if( Acad::eOk == pTrans->getObject( pObj, objId, AcDb::kForWrite, !erasing ) )
    {
        pObj->erase( erasing ); // (反)删除图元
    }
    actrTransactionManager->endTransaction();
}
开发者ID:kanbang,项目名称:TIDS,代码行数:12,代码来源:ArxEntityHelper.cpp

示例5: EraseObjects

void ArxEntityHelper::EraseObjects( const AcDbObjectIdArray& objIds, Adesk::Boolean erasing )
{
    if( objIds.isEmpty() ) return;

    AcTransaction* pTrans = actrTransactionManager->startTransaction();
    if( pTrans == 0 ) return;

    int len = objIds.length();
    for( int i = 0; i < len; i++ )
    {
        AcDbObject* pObj;
        if( Acad::eOk != pTrans->getObject( pObj, objIds[i], AcDb::kForWrite, !erasing ) ) continue;
        pObj->erase( erasing ); // (反)删除图元
    }
    actrTransactionManager->endTransaction();
}
开发者ID:kanbang,项目名称:TIDS,代码行数:16,代码来源:ArxEntityHelper.cpp

示例6: removeEmpCommand

void removeEmpCommand()
{ 
    //this cannot really happen but...
    if (acdbHostApplicationServices()->workingDatabase()==NULL)
        return;
    try
    {
        //start transaction for the db operations in this command
        actrTransactionManager->startTransaction();

        //get you extension dictionary
        AcDbDictionary* pExtDict = NULL;
        getExtDictOfObject(pExtDict);
        
        //get the id from the EmployeeDetails object
        //see if our dictionary is there
        AcDbObjectId idO;
        ARXOK(pExtDict->getAt(DICT,idO));

        //get it for write 
        AcDbObject* pO;
        ARXOK(actrTransactionManager->getObject(pO,idO,AcDb::kForWrite));

        //check if someone has else has created an entry with our name
        //that is not a dictionary. This should never happen as long as
        //I use the registered developer ID.
        AcDbDictionary* pEmployeeDict=NULL;
        if ((pEmployeeDict=AcDbDictionary::cast(pO))==NULL)
            throw Acad::eNotThatKindOfClass;

        //check if a record with this key is there
        ARXOK(pEmployeeDict->getAt(DETAILS,idO));

        //get it for write 
        ARXOK(actrTransactionManager->getObject(pO,idO,AcDb::kForWrite));
        
        EmployeeDetails* pEmployeeDetails;
        if ((pEmployeeDetails=EmployeeDetails::cast(pO))==NULL)
            throw Acad::eNotThatKindOfClass;

        //create string key from the employee id
        char strID[33];
        sprintf(strID,"%d",pEmployeeDetails->ID());

        //and then erase it
        ARXOK(pO->erase());

        //get hold of the NOD
        AcDbDictionary* pNOD;
        ARXOK(getNOD(pNOD,AcDb::kForWrite));
        
        //remove the EmployeeEntry from NOD
        removeEntryFromDict(DICT,pNOD,strID);

        actrTransactionManager->endTransaction();
    }
    catch (const Acad::ErrorStatus es)
    {
        //abort, rollback all db operations
        actrTransactionManager->abortTransaction();
        //check if the user has cancelled us, then we don't report
        //anything
        if (es!=Acad::eUserBreak)
            acutPrintf("***Error: %s\n",acadErrorStatusText(es));
    }
}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:66,代码来源:lab6commandmain.cpp


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