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


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

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


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

示例1: if

void
ArxDbgAppEditorReactor::searchOneDictionary(AcDbDictionary* dict, AcDbObjectIdArray& objIds)
{
        // get an iterator over this dictionary
    AcDbDictionaryIterator* dictIter = dict->newIterator();
    ASSERT(dictIter != NULL);

        // walk dictionary and just collect all the entries that are of the
        // given type
    AcDbObject* obj;
    for (; !dictIter->done(); dictIter->next()) {
        if (acdbOpenAcDbObject(obj, dictIter->objectId(), AcDb::kForRead) == Acad::eOk) {
            if (obj->isKindOf(ArxDbgDbDictRecord::desc())) {
                objIds.append(obj->objectId());
            }
            else if (obj->isKindOf(AcDbDictionary::desc())) {
                searchOneDictionary(AcDbDictionary::cast(obj), objIds);
            }

            obj->close();
        }
    }
    delete dictIter;
    dict->close();
}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:25,代码来源:ArxDbgAppEditorReactor.cpp

示例2: addXData

void addXData()
{
	// Get an Entity.
	ads_name mnEnt;
    ads_point ptSel;
    int nRet = acedEntSel(_T("\nSelect an Entity: "), mnEnt, ptSel);
	if (nRet != RTNORM)
		return;
	AcDbObjectId oid;
	
    Acad::ErrorStatus retStat;
    retStat = acdbGetObjectId(oid, mnEnt);
    if (retStat != Acad::eOk)
		return;

    AcDbObject* pObj = NULL;

    if ((retStat = acdbOpenObject(pObj, oid, AcDb::kForRead)) != Acad::eOk)
    {
        return;
    }
	// Get new XData.
	TCHAR appName[132] = {0};
	TCHAR resString[200] = {0};

    acedGetString(NULL, _T("\nEnter application name: "), appName);
    acedGetString(NULL, _T("\nEnter string to be added: "), resString);

    // XData
    resbuf *pRb = NULL;
	resbuf *pTemp = NULL;
    
    pRb = pObj->xData(appName);

    if (pRb != NULL)
	{
        for (pTemp = pRb; pTemp->rbnext != NULL; pTemp = pTemp->rbnext);
    }
	else
	{
        acdbRegApp(appName);
        pRb = acutNewRb(AcDb::kDxfRegAppName);
        pTemp = pRb;
        pTemp->resval.rstring = (TCHAR*)malloc((_tcslen(appName) + 1) * sizeof(TCHAR));
        _tcscpy(pTemp->resval.rstring, appName);
    }

    pTemp->rbnext = acutNewRb(AcDb::kDxfXdAsciiString);
    pTemp = pTemp->rbnext;
    pTemp->resval.rstring = (TCHAR*)malloc((_tcslen(resString) + 1) * sizeof(TCHAR));
    _tcscpy(pTemp->resval.rstring, resString);

	// Set XData.
    pObj->upgradeOpen();
    pObj->setXData(pRb);
    
    pObj->close();
    acutRelRb(pRb);
}
开发者ID:kevinzhwl,项目名称:ZRXSDKMod,代码行数:59,代码来源:XData.cpp

示例3: idPair

void
ArxDbgAppEditorReactor::insertCloneMergeDicts(AcDbDictionary* srcDict,
                AcDbDictionary* destDict, AcDbIdMapping& idMap)
{
    AcDbObjectId tmpObjId;
    AcDbObject* objToClone;
    AcDbObject* clonedObj;
    AcDbDictionaryIterator* iter;
    iter = srcDict->newIterator();

    for (; !iter->done(); iter->next()) {
        iter->getObject(objToClone, AcDb::kForRead);
        
            // if an entry with this name is found already, don't clone
            // it, add to the idMap to say that this one got translated
            // to one that already exists
        const char *pName = iter->name();
        if (destDict->getAt(pName, tmpObjId) == Acad::eOk) {
            AcDbIdPair idPair(objToClone->objectId(), tmpObjId, true, false, true);
            idMap.assign(idPair);
            objToClone->close();
        }
        else {
                // doesn't exist yet in the destination dict, so clone and
                // place it there.
            clonedObj = NULL;
            objToClone->deepClone(destDict, clonedObj, idMap);

                // INSERT usually uses a method of cloning
                // called CheapClone, where it "moves" objects
                // into the destination database instead of
                // actually cloning them.  When this happens,
                // objToClone and clonedObj are pointers to the
                // same object.  We only want to close pObj
                // here if it really is a different object.
            if (objToClone != clonedObj)
                objToClone->close();

            if (clonedObj) {
                destDict->setAt(pName, clonedObj, tmpObjId);
                clonedObj->close();
            }
        }
    }
    delete iter;
}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:46,代码来源:ArxDbgAppEditorReactor.cpp

示例4: acedEntSel

// This is the main function of this app.  It allows the
// user to select an entity.  It then checks to see if the
// entity is a 2d-polyline.  If so, then it calls iterate
// passing in the objectId of the pline.
// 
void
listPline()
{
    int rc;
    ads_name en;
    AcGePoint3d pt;
    rc = acedEntSel(_T("\nSelect a polyline: "), en,
        asDblArray(pt));

    if (rc != RTNORM) {
        acutPrintf(_T("\nError during object selection"));
        return;
    }

    AcDbObjectId eId;
    acdbGetObjectId(eId, en);

    AcDbObject *pObj;
    acdbOpenObject(pObj, eId, AcDb::kForRead);
    if (pObj->isKindOf(AcDb2dPolyline::desc())) {
        pObj->close();
        iterate(eId);
    } else {
        pObj->close();
        acutPrintf(_T("\nSelected entity is not an AcDb2dPolyline. \nMake sure the setvar PLINETYPE is set to 0 before createing a polyline"));
    }
}
开发者ID:FengLuanShuangWu,项目名称:AutoCADPlugin-HeatSource,代码行数:32,代码来源:pliniter.cpp

示例5: acdbOpenAcDbObject

bool
ArxDbgUtils::isOnLockedLayer(AcDbEntity* ent, bool printMsg)
{
    AcDbObject* obj;
    AcDbLayerTableRecord* layer;
    bool isLocked = false;
    Acad::ErrorStatus es;

    es = acdbOpenAcDbObject(obj, ent->layerId(), AcDb::kForRead);
    if (es == Acad::eOk) {
        layer = AcDbLayerTableRecord::cast(obj);
        if (layer)
            isLocked = layer->isLocked();
        else {
            ASSERT(0);
        }
        obj->close();
    }
    else {
        ASSERT(0);
        ArxDbgUtils::rxErrorMsg(es);
    }

    if (isLocked && printMsg) {
        acutPrintf(_T("\nSelected entity is on a locked layer."));
    }

    return isLocked;
}
开发者ID:FengLuanShuangWu,项目名称:AutoCADPlugin-HeatSource,代码行数:29,代码来源:ArxDbgUtilsSymTbl.cpp

示例6: ASSERT

void
ArxDbgUiTdcObjects::displayCurrent(int index)
{
    // remove any previous entries
    m_fieldStrList.RemoveAll();
    m_valueStrList.RemoveAll();

    ASSERT((index >= 0) && (index < m_objList.length()));
    if(m_objList.length()==0)
        return;//done


    m_currentObjId = m_objList[index];

    CString str;

    AcDbObject* obj = NULL;
    Acad::ErrorStatus es = acdbOpenObject(obj, m_currentObjId, AcDb::kForRead, true);	// might want to show erased
    setExtensionButtons(obj);

    if (es == Acad::eOk) {
        display(obj);

        // hide or show the erased entity message
        if (obj->isErased())
            m_txtErased.ShowWindow(SW_SHOW);
        else
            m_txtErased.ShowWindow(SW_HIDE);

        obj->close();
    }

    drawPropsList(m_dataList);
}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:34,代码来源:ArxDbgUiTdcObjects.cpp

示例7: RegDict

void ArxDictTool::RegDict( const CString& dictName )
{
    // 初始化工作,建立存储词典
    AcDbDictionary* pNamedobj;
    acdbHostApplicationServices()->workingDatabase()->getNamedObjectsDictionary( pNamedobj, AcDb::kForWrite );

    AcDbObject* pObj;
    Acad::ErrorStatus es = pNamedobj->getAt( dictName, pObj, AcDb::kForRead );
    if( Acad::eOk ==  es )
    {
        pObj->close();
    }
    else if( Acad::eKeyNotFound == es )
    {
        AcDbDictionary* pDict = new AcDbDictionary();
        AcDbObjectId dictId;
        if( Acad::eOk != pNamedobj->setAt( dictName, pDict, dictId ) )
        {
            delete pDict;
        }
        else
        {
            pDict->close();
        }
    }
    pNamedobj->close();
}
开发者ID:hunanhd,项目名称:cbm,代码行数:27,代码来源:ArxDictTool.cpp

示例8: acdbOpenAcDbObject

BOOL
ArxDbgUiTdcObjects::OnInitDialog()
{
    ArxDbgUiTdcDbObjectBase::OnInitDialog();

    m_lbObjList.ResetContent();

    AcDbObject* obj;
    CString str;
    Acad::ErrorStatus es;

    int len = m_objList.length();
    for (int i=0; i<len; i++) {
        es = acdbOpenAcDbObject(obj, m_objList[i], AcDb::kForRead, true);		// might have passed in erased ones
        if (es == Acad::eOk) {
            ArxDbgUtils::objToClassAndHandleStr(obj, str);
            m_lbObjList.AddString(str);
            obj->close();
        }
    }

    m_lbObjList.SetCurSel(0);

    buildColumns(m_dataList);
    displayCurrent(0);

    return TRUE;
}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:28,代码来源:ArxDbgUiTdcObjects.cpp

示例9: acdbOpenAcDbObject

void
ArxDbgUiTdcObjReactorsBase::displayEntList() 
{
	m_entsAttached.setLogicalLength(0);
	m_lbEntList.ResetContent();

	getAttachedEntities(m_entsAttached);

	CString str;
	Acad::ErrorStatus es;
	AcDbObject* obj;

    int len = m_entsAttached.length();
    for (int i=0; i<len; i++) {
		es = acdbOpenAcDbObject(obj, m_entsAttached[i], AcDb::kForRead, true);
		if (es == Acad::eOk) {
			ArxDbgUtils::objToClassAndHandleStr(obj, str);

			if (obj->isErased())
				str += _T("  (erased)");

			m_lbEntList.AddString(str);

			obj->close();
		}
    }

	setButtonModes();
}
开发者ID:FengLuanShuangWu,项目名称:AutoCADPlugin-HeatSource,代码行数:29,代码来源:ArxDbgUiTdcObjReactorsBase.cpp

示例10: if

void
ArxDbgUtils::collectVertices(const AcDbPolyFaceMesh* pface, AcDbObjectIdArray& vfaces, AcGePoint3dArray& pts)
{
    AcDbObjectIterator*  vertexIter = pface->vertexIterator();
    if (vertexIter == NULL)
        return;

    AcDbFaceRecord* vface;
    AcDbPolyFaceMeshVertex* pfaceVertex;
    AcDbObject* obj;

        // walk through and seperate vfaces and vertices into two
        // seperate arrays
    Acad::ErrorStatus es;
    for (; !vertexIter->done(); vertexIter->step()) {
        es = acdbOpenObject(obj, vertexIter->objectId(), AcDb::kForRead);
        if (es == Acad::eOk) {
            if ((vface = AcDbFaceRecord::cast(obj)) != NULL)
                vfaces.append(obj->objectId());
            else if ((pfaceVertex = AcDbPolyFaceMeshVertex::cast(obj)) != NULL)
                pts.append(pfaceVertex->position());
            else {
                ASSERT(0);
            }
            obj->close();
        }
        else
            ArxDbgUtils::rxErrorMsg(es);
    }
    delete vertexIter;
}
开发者ID:FengLuanShuangWu,项目名称:AutoCADPlugin-HeatSource,代码行数:31,代码来源:ArxDbgUtilsDb.cpp

示例11: selectObject

// The listxrecord() functions gets the xrecord associated with the 
// key "ASDK_XREC1" and lists out its contents by passing the resbuf 
// list to the function printList().
// 
void
listXrecord()
{
    AcDbObject *pObj;
    AcDbXrecord *pXrec;
    AcDbObjectId dictObjId;
    AcDbDictionary *pDict;

    pObj = selectObject(AcDb::kForRead);
    if (pObj == NULL) {
        return;
    }
    // Get the object ID of the object's extension dictionary.
    //
    dictObjId = pObj->extensionDictionary();
    pObj->close();

    // Open the extension dictionary and get the xrecord
    // associated with the key ASDK_XREC1.
    // 
    acdbOpenObject(pDict, dictObjId, AcDb::kForRead);
    pDict->getAt("ASDK_XREC1", (AcDbObject*&)pXrec,
        AcDb::kForRead);
    pDict->close();

    // Get the xrecord's data list and then close the xrecord.
    //
    struct resbuf *pRbList;
    pXrec->rbChain(&pRbList);
    pXrec->close();

    printList(pRbList);
    acutRelRb(pRbList);
}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:38,代码来源:xtsndict.cpp

示例12: 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

示例13: 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

示例14:

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

示例15: getLinkedGE

LinkedGE* VentCaculate::getLinkedGE(AcDbObjectId objId)
{
	AcDbObject* pObj;
	acdbOpenObject( pObj, objId, AcDb::kForRead );

	LinkedGE* pEdge = LinkedGE::cast( pObj );
	pObj->close();

	return pEdge;
}
开发者ID:kanbang,项目名称:TIDS,代码行数:10,代码来源:RqAirflowCacul.cpp


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