这篇教程C++ AcDbObject类代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中AcDbObject类的典型用法代码示例。如果您正苦于以下问题:C++ AcDbObject类的具体用法?C++ AcDbObject怎么用?C++ AcDbObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。 在下文中一共展示了AcDbObject类的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: ASSERTvoidArxDbgAppEditorReactor::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,
示例2: addXDatavoid 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,
示例3: acdbHostApplicationServicesvoid 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,
示例4: acdbOpenAcDbObjectboolArxDbgUtils::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,
示例5: ASSERTvoidArxDbgUiTdcObjects::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,
示例6: ifvoidArxDbgUtils::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,
示例7: acdbOpenAcDbObjectBOOLArxDbgUiTdcObjects::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,
示例8: removeEntryFromDictvoidremoveEntryFromDict(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,
示例9: getAttachedEntitiesvoidArxDbgUiTdcObjReactorsBase::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,
示例10: listXrecord// 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().// voidlistXrecord(){ 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,
示例11: mapItervoidArxDbgAppEditorReactor::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,
示例12: listPline// 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.// voidlistPline(){ 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,
示例13: acdbCurDwgAcad::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,
示例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,
示例15: getLinkedGELinkedGE* VentCaculate::getLinkedGE(AcDbObjectId objId){ AcDbObject* pObj; acdbOpenObject( pObj, objId, AcDb::kForRead ); LinkedGE* pEdge = LinkedGE::cast( pObj ); pObj->close(); return pEdge;}
开发者ID:kanbang,项目名称:TIDS,代码行数:10,
示例16: createXrecord// The createXrecord() functions creates an xrecord object, // adds data to it, and then adds the xrecord to the extension // dictionary of a user selected object.// // THE FOLLOWING CODE APPEARS IN THE SDK DOCUMENT.//voidcreateXrecord(){ AcDbXrecord *pXrec = new AcDbXrecord; AcDbObject *pObj; AcDbObjectId dictObjId, xrecObjId; AcDbDictionary* pDict; pObj = selectObject(AcDb::kForWrite); if (pObj == NULL) { return; } // Try to create an extension dictionary for this // object. If the extension dictionary already exists, // this will be a no-op. // pObj->createExtensionDictionary(); // Get the object ID of the extension dictionary for the // selected object. // dictObjId = pObj->extensionDictionary(); pObj->close(); // Open the extension dictionary and add the new // xrecord to it. // acdbOpenObject(pDict, dictObjId, AcDb::kForWrite); pDict->setAt("ASDK_XREC1", pXrec, xrecObjId); pDict->close(); // Create a resbuf list to add to the xrecord. // struct resbuf* head; ads_point testpt = {1.0, 2.0, 0.0}; head = acutBuildList(AcDb::kDxfText, "This is a test Xrecord list", AcDb::kDxfXCoord, testpt, AcDb::kDxfReal, 3.14159, AcDb::kDxfAngle, 3.14159, AcDb::kDxfColor, 1, AcDb::kDxfInt16, 180, 0); // Add the data list to the xrecord. Notice that this // member function takes a reference to a resbuf NOT a // pointer to a resbuf, so you must dereference the // pointer before sending it. // pXrec->setFromRbChain(*head); pXrec->close(); acutRelRb(head);}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:60,
示例17: EraseObjectvoid 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,
示例18: acdbOpenAcDbObjectLPCTSTRArxDbgUtils::objIdToHandleStr(const AcDbObjectId& objId, CString& str){ AcDbObject* obj; Acad::ErrorStatus es; es = acdbOpenAcDbObject(obj, objId, AcDb::kForRead); if (es != Acad::eOk) str = ACDB_NULL_HANDLE; else { ArxDbgUtils::objToHandleStr(obj, str); obj->close(); } return str;}
开发者ID:FengLuanShuangWu,项目名称:AutoCADPlugin-HeatSource,代码行数:14,
示例19: EraseObjectsvoid 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,
示例20: acdbOpenAcDbObjectvoidArxDbgEditorReactor::printReactorMessage(LPCTSTR event, const AcDbObjectId& objId) const{ CString str; AcDbObject* obj; Acad::ErrorStatus es = acdbOpenAcDbObject(obj, objId, AcDb::kForRead); if (es == Acad::eOk) { acutPrintf(_T("/n%-15s : [%-18s: %s, %s] "), _T("[ED REACTOR]"), event, ArxDbgUtils::objToClassStr(obj), ArxDbgUtils::objToHandleStr(obj, str)); obj->close(); } else { ArxDbgUtils::rxErrorMsg(es); printReactorMessage(event); }}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:16,
示例21: acdbOpenAcDbObjectvoidArxDbgUiTdcPersistentReactors::attachObjReactors(const AcDbObjectIdArray& objIds){ Acad::ErrorStatus es; AcDbObject* obj; ArxDbgPersistentObjReactor* peReactor; AcDbObjectId prId; ArxDbgDocLockWrite docLock; // these potentially came from other documents int len = objIds.length(); for (int i=0; i<len; i++) { es = docLock.lock(objIds[i].database()); // lock the document associated with this database if (es == Acad::eOk) { es = acdbOpenAcDbObject(obj, objIds[i], AcDb::kForWrite, true); if (es == Acad::eOk) { prId = getPersistentObjReactor(objIds[i].database(), true); if (ArxDbgUiTdmReactors::hasPersistentReactor(obj, prId)) { ArxDbgUtils::alertBox(_T("That object already has the reactor attached.")); } else { obj->addPersistentReactor(prId); es = acdbOpenObject(peReactor, prId, AcDb::kForWrite); if (es == Acad::eOk) { peReactor->attachTo(obj->objectId()); peReactor->close(); } else { CString str; str.Format(_T("ERROR: Could not update backward reference in reactor: (%s)"), ArxDbgUtils::rxErrorStr(es)); ArxDbgUtils::stopAlertBox(str); } } obj->close(); } else { ArxDbgUtils::rxErrorMsg(es); } } else { ArxDbgUtils::rxErrorAlert(es); } }}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:47,
示例22: printXDatavoid printXData(){ // 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 the application name for the xdata. // TCHAR appname[133] = {0}; if (acedGetString(NULL, _T("/nEnter the Xdata application name: "), appname) != RTNORM) { return; } // Get the xdata for the application name. // resbuf *pRb = pObj->xData(appname); if (pRb != NULL) { printXDList(pRb); acutRelRb(pRb); } else { acutPrintf(_T("/nNo xdata for appname: %s."), appname); } pObj->close();}
开发者ID:kevinzhwl,项目名称:ZRXSDKMod,代码行数:45,
示例23: acdbOpenAcDbObjectvoidArxDbgUiTdcReferences::addEntriesToTree(const AcDbObjectIdArray& ids, HTREEITEM parent){ AcDbObject* tmpObj; HTREEITEM treeItem; Acad::ErrorStatus es; CString str; int len = ids.length(); for (int i=0; i<len; i++) { es = acdbOpenAcDbObject(tmpObj, ids[i], AcDb::kForRead, true); // might have passed in erased ones if (es == Acad::eOk) { treeItem = addOneTreeItem(ArxDbgUtils::objToClassAndHandleStr(tmpObj, str), tmpObj, parent); tmpObj->close(); } else ArxDbgUtils::rxErrorMsg(es); }}
开发者ID:FengLuanShuangWu,项目名称:AutoCADPlugin-HeatSource,代码行数:19,
示例24: acdbOpenObjectvoidArxDbgTransientEntReactor::delFromAll(){ AcDbObject* obj; Acad::ErrorStatus es; int length = m_objList.length(); for (int i=0; i<length; i++) { // must open erased entities too! es = acdbOpenObject(obj, m_objList[i], AcDb::kForWrite, true); if (es == Acad::eOk) { obj->removeReactor(this); obj->close(); } else ArxDbgUtils::rxErrorAlert(es); } m_objList.setLogicalLength(0);}
开发者ID:FengLuanShuangWu,项目名称:AutoCADPlugin-HeatSource,代码行数:19,
示例25: printXDatabool printXData(){ CLogger::Print(_T("*Call: printxData()")); AcDbObject* pObj; //------------ // Require to select an entity if (!(pObj = selectObject(AcDb::kForRead))) { CLogger::Print(_T("*Exit: printxData() - Object have not selected.")); return false; } //------------ // Require to enter xData application name ACHAR appname[133]; if (RTNORM != acedGetString(NULL, ACRX_T("/nEnter the desired Xdata application name: "), appname)) { CLogger::Print(_T("*Exit: printxData() - Fail to enter the application name!")); return false; } //------------ // Read the xData that contained in object. // If application name is existing then print out its values. struct resbuf* pRb; pRb = pObj->xData(appname); pObj->close(); if (pRb) { acutPrintf(ACRX_T("Inform: Application name '%s' is existing - The values are: "), appname); printList(pRb); acutRelRb(pRb); // release xData after using! } else { acutPrintf(ACRX_T("/n*Exit: printxData() - Application name '%s' is not existing."), appname); pObj->close(); return false; } pObj->close(); CLogger::Print(_T("*Exit: printxData()")); return true;}
开发者ID:vuonganh1993,项目名称:arxlss,代码行数:41,
示例26: acdbOpenAcDbObjectvoidArxDbgUiTdcWblockClone::divideCloneSet(const AcDbObjectIdArray& cloneSet, AcDbObjectIdArray& nonEntSet, AcDbObjectIdArray& okToCloneSet){ Acad::ErrorStatus es; AcDbObject* obj; int len = cloneSet.length(); for (int i=0; i<len; i++) { es = acdbOpenAcDbObject(obj, cloneSet[i], AcDb::kForRead); if (es == Acad::eOk) { if (obj->isKindOf(AcDbEntity::desc())) okToCloneSet.append(obj->objectId()); else nonEntSet.append(obj->objectId()); obj->close(); } }}
开发者ID:FengLuanShuangWu,项目名称:AutoCADPlugin-HeatSource,代码行数:21,
示例27: GetTagGEById2_Helperstatic void GetTagGEById2_Helper( const CString& geType, const AcDbObjectIdArray& allObjIds, AcDbObjectIdArray& objIds ){ AcRxClass* pClass = AcRxClass::cast( acrxClassDictionary->at( geType ) ); if( pClass == 0 ) return; AcTransaction* pTrans = actrTransactionManager->startTransaction(); if( pTrans == 0 ) return; int len = allObjIds.length(); for( int i = 0; i < len; i++ ) { AcDbObject* pObj; if( Acad::eOk != pTrans->getObject( pObj, allObjIds[i], AcDb::kForRead ) ) continue; if( pObj->isKindOf( pClass ) ) { objIds.append( allObjIds[i] ); } } actrTransactionManager->endTransaction();}
开发者ID:kanbang,项目名称:myexercise,代码行数:21,
示例28: printXdata// This function calls the// selectObject() function to allow the user to pick an// object; then it accesses the xdata of the object and// sends the list to the printList() function that lists the// restype and resval values.// voidprintXdata(){ // Select and open an object. // AcDbObject *pObj; if ((pObj = selectObject(AcDb::kForRead)) == NULL) { return; } // Get the application name for the xdata. // TCHAR appname[133]; if (acedGetString(NULL, _T("/nEnter the desired Xdata application name: "), appname) != RTNORM) { return; } // Get the xdata for the application name. // struct resbuf *pRb; pRb = pObj->xData(appname); if (pRb != NULL) { // Print the existing xdata if any is present. // Notice that there is no -3 group, as there is in // LISP. This is ONLY the xdata, so // the -3 xdata-start marker isn't needed. // printList(pRb); acutRelRb(pRb); } else { acutPrintf(_T("/nNo xdata for this appname")); } pObj->close();}
开发者ID:FengLuanShuangWu,项目名称:AutoCADPlugin-HeatSource,代码行数:46,
示例29: delAllReactorbool ZcEntityReactor::delAllReactor(){ Acad::ErrorStatus es; AcDbObject* pObj = NULL; int nLength = m_objIdList.length(); for (int i = 0; i < nLength; i++) { es = acdbOpenObject(pObj, m_objIdList[i], AcDb::kForWrite, true); if (es == Acad::eOk) { pObj->removeReactor(this); pObj->close(); } else { return false; } } m_objIdList.removeAll(); return true;}
开发者ID:kevinzhwl,项目名称:ZRXSDKMod,代码行数:22,
示例30: GetDataObjectFromDict// 获取词典下的所有static void GetDataObjectFromDict( const CString& dictName, AcDbObjectIdArray& dbObjIds ){ AcDbObjectIdArray allObjIds; ArxDictTool2* pDict = ArxDictTool2::GetDictTool( dictName ); pDict->getAllEntries( allObjIds ); delete pDict; AcTransaction* pTrans = actrTransactionManager->startTransaction(); if( pTrans == 0 ) return; int len = allObjIds.length(); for( int i = 0; i < len; i++ ) { AcDbObject* pObj; if( Acad::eOk != pTrans->getObject( pObj, allObjIds[i], AcDb::kForRead ) ) continue; if( pObj->isKindOf( DataObject::desc() ) ) { dbObjIds.append( allObjIds[i] ); } } actrTransactionManager->endTransaction();}
开发者ID:kanbang,项目名称:myexercise,代码行数:24,
注:本文中的AcDbObject类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ AcDbObjectId类代码示例 C++ AcDbEntity类代码示例 |