这篇教程C++ AcDbBlockTable类代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中AcDbBlockTable类的典型用法代码示例。如果您正苦于以下问题:C++ AcDbBlockTable类的具体用法?C++ AcDbBlockTable怎么用?C++ AcDbBlockTable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。 在下文中一共展示了AcDbBlockTable类的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: FindLinesByPoint// 查找连接点junctionPt关联的分支图元(包含隐形的图元)static void FindLinesByPoint( const AcGePoint3d& junctionPt, AcDbObjectIdArray& objIds ){ AcDbBlockTable* pBlkTbl; acdbHostApplicationServices()->workingDatabase()->getSymbolTable( pBlkTbl, AcDb::kForRead ); AcDbBlockTableRecord* pBlkTblRcd; pBlkTbl->getAt( ACDB_MODEL_SPACE, pBlkTblRcd, AcDb::kForRead ); pBlkTbl->close(); AcDbBlockTableRecordIterator* pBlkTblRcdItr; pBlkTblRcd->newIterator( pBlkTblRcdItr ); for ( pBlkTblRcdItr->start(); !pBlkTblRcdItr->done(); pBlkTblRcdItr->step() ) { // 不采用transaction的方法查找LinkedGE, // 等价于排除当前正在以write状态编辑的LinkedGE // 重要(***) AcDbEntity* pEnt = 0; if( Acad::eOk != pBlkTblRcdItr->getEntity( pEnt, AcDb::kForRead ) ) continue; LinkedGE* pEdge = LinkedGE::cast( pEnt ); if( pEdge != 0 ) { AcGePoint3d startPt, endPt; pEdge->getSEPoint( startPt, endPt ); if( startPt == junctionPt || endPt == junctionPt ) { objIds.append( pEdge->objectId() ); } } pEnt->close(); } delete pBlkTblRcdItr; pBlkTblRcd->close();}
开发者ID:kanbang,项目名称:TIDS,代码行数:36,
示例2: acdbHostApplicationServicesvoid BlockDraw_ConfigDlg::fillBlockList(){ // 清空 m_blockList.ResetContent(); // 填充块列表 AcDbBlockTable* pBlockTable; acdbHostApplicationServices()->workingDatabase() ->getSymbolTable( pBlockTable, AcDb::kForRead ); // Iterate through the block table and disaply the names in the list box. AcString name; AcDbBlockTableIterator* pBTItr; if ( pBlockTable->newIterator( pBTItr ) == Acad::eOk ) { while ( !pBTItr->done() ) { AcDbBlockTableRecord* pRecord; if ( pBTItr->getRecord( pRecord, AcDb::kForRead ) == Acad::eOk ) { pRecord->getName( name ); // 排除默认的2个块定义(模型空间和图纸空间) if( name.find( ACDB_MODEL_SPACE ) < 0 && name.find( ACDB_PAPER_SPACE ) < 0 ) { m_blockList.AddString( name.kACharPtr() ); } pRecord->close(); } pBTItr->step(); } } pBlockTable->close();}
开发者ID:kanbang,项目名称:TIDS,代码行数:33,
示例3: AcDbPolylineAcDbObjectId Additional_Class::Draw_Rectangle( AcGePoint2d stPt, double length, double height ){ AcDbPolyline *pPolyline = new AcDbPolyline(4); AcGePoint2d stPt1, stPt2, stPt3, stPt4; stPt1 = stPt; pPolyline->addVertexAt(0, stPt1, 0, 0, 0); stPt2.x = stPt.x +length; stPt2.y = stPt.y; pPolyline->addVertexAt(1, stPt2, 0, 0, 0); stPt3.x = stPt2.x; stPt3.y = stPt2.y + height; pPolyline->addVertexAt(2, stPt3, 0, 0, 0); stPt4.x = stPt3.x - length; stPt4.y = stPt3.y; pPolyline->addVertexAt(3, stPt4, 0, 0, 0); pPolyline->setClosed(Adesk::kTrue); AcDbBlockTable *pBlockTable = NULL; acdbHostApplicationServices()->workingDatabase()->getBlockTable(pBlockTable, AcDb::kForRead); //this->Open_BlockTable(pBlockTable, NREADMODE); AcDbBlockTableRecord *pBlockTableRecord = NULL; pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForWrite); //acdbHostApplicationServices()->workingDatabase()->getBlockTable(pBlockTable, AcDb::kForRead); //this->Open_ModelTableRecord(pBlockTableRecord, pBlockTable, NWRITEMODE); AcDbObjectId TempLineID; pBlockTableRecord->appendAcDbEntity(TempLineID, pPolyline); pPolyline->close(); pBlockTable->close(); pBlockTableRecord->close(); return TempLineID;}
开发者ID:TobeGodman,项目名称:AutoTrader,代码行数:30,
示例4: readDatabasevoid readDatabase(){ // Use kFalse to create an empty database. AcDbDatabase *pDb = new AcDbDatabase(Adesk::kFalse); // Use readDwgFile to load the DWG file. acutPrintf(_T("/nRead file /"d://temp//testfile.dwg/".")); if(Acad::eOk != pDb->readDwgFile(_T("d://temp//testfile.dwg"))) return; // Get the BlockTable. AcDbBlockTable *pBTable = NULL; pDb->getSymbolTable(pBTable, AcDb::kForRead); // Get the ModelSpace. AcDbBlockTableRecord *pRecord = NULL; pBTable->getAt(ACDB_MODEL_SPACE, pRecord, AcDb::kForRead); pBTable->close(); // Get new iterator. AcDbBlockTableRecordIterator *pItr = NULL; pRecord->newIterator(pItr); AcDbEntity *pEnt = NULL; for (pItr->start(); !pItr->done(); pItr->step()) { pItr->getEntity(pEnt, AcDb::kForRead); acutPrintf(_T("/nclassname: %s"), (pEnt->isA())->name()); pEnt->close(); } pRecord->close(); delete pItr; delete pDb;}
开发者ID:kevinzhwl,项目名称:ZRXSDKMod,代码行数:34,
示例5: AcDbTableAcDbObjectId Additional_Class::Creat_Table(AcGePoint3d TablePoint, vector<CString> Title, double ColWidth, double RowHeight, double TextHeight){ AcDbTable *pTable = new AcDbTable(); AcDbObjectId TableID; pTable->setNumColumns(Title.size()); pTable->setNumRows(1); pTable->setColumnWidth(ColWidth); pTable->setRowHeight(RowHeight); pTable->setDirection(AcGeVector3d(1,0,0)); pTable->setNormal(AcGeVector3d(0,0,1)); pTable->setPosition(TablePoint); AcDbBlockTable *pBlockTable; AcDbBlockTableRecord *pBlockTableRecord; acdbHostApplicationServices()->workingDatabase()->getBlockTable(pBlockTable, AcDb::kForRead); pBlockTable->getAt(ACDB_MODEL_SPACE,pBlockTableRecord,AcDb::kForWrite); pBlockTableRecord->appendAcDbEntity(TableID, pTable); //pBlockTable->close(); pBlockTableRecord->close(); //pTable->setTextString(0,0, "桩 号"); //pTable->setTextHeight(0,0,10); //pTable->setTextString(0,1, "X坐标值"); //pTable->setTextHeight(0,1,10); //pTable->setTextString(0,2, "Y坐标值"); //pTable->setTextHeight(0,2,10); //pTable->setTextString(0,3, "特性值"); //pTable->setTextHeight(0,3,10); //pTable->setTextString(0,4, "长 度"); //pTable->setTextHeight(0,4,10); pTable->close(); return TableID;}
开发者ID:TobeGodman,项目名称:AutoTrader,代码行数:32,
示例6: postToDatabaseAcad::ErrorStatus postToDatabase (/*[in]*/AcDbDatabase *pDb /*=NULL*/, AcDbEntity *pEnt, AcDbObjectId &idObj) { //----- Purpose: //----- Adds an entity to the MODEL_SPACE of the database given in argument. //----- * pDb: pointer to the databse where to add the entity, //----- if NULL, then the curretn database is used. //----- * pEnt: pointer to an entity instance. //----- * idObj: it will contain the assign ID to the object if successfully added to the database. //----- Note: //----- The entity object is closed while we return from that function. Only the idObj can be used after. assert ( pEnt != NULL ) ; if ( pDb == NULL ) pDb =acdbHostApplicationServices ()->workingDatabase () ; //----- Get a pointer to the current drawing //----- and get the drawing's block table. Open it for read. Acad::ErrorStatus es ; AcDbBlockTable *pBlockTable ; if ( (es =pDb->getBlockTable (pBlockTable, AcDb::kForRead)) == Acad::eOk ) { //----- Get the Model Space record and open it for write. This will be the owner of the new line. AcDbBlockTableRecord *pSpaceRecord ; if ( (es =pBlockTable->getAt (ACDB_MODEL_SPACE, pSpaceRecord, AcDb::kForWrite)) == Acad::eOk ) { //----- Append pEnt to Model Space, then close it and the Model Space record. if ( (es =pSpaceRecord->appendAcDbEntity (idObj, pEnt)) == Acad::eOk ) pEnt->close () ; pSpaceRecord->close () ; } pBlockTable->close () ; } //----- It is good programming practice to return an error status return (es) ;}
开发者ID:FengLuanShuangWu,项目名称:AutoCADPlugin-HeatSource,代码行数:31,
示例7: ASSERTAcad::ErrorStatusArxDbgUtils::defineNewAnonymousBlock(AcDbBlockTableRecord*& newBlkRec, AcDbObjectId& newBlkRecId, AcDbDatabase* db){ ASSERT(db != NULL); AcDbBlockTable* blkTbl; Acad::ErrorStatus es = db->getSymbolTable(blkTbl, AcDb::kForWrite); if (es != Acad::eOk) return es; newBlkRec = new AcDbBlockTableRecord; newBlkRec->setPathName(AcadString::nullStr); // constructor doesn't do it properly es = newBlkRec->setName(_T("*U")); if (es == Acad::eOk) es = blkTbl->add(newBlkRecId, newBlkRec); if (es != Acad::eOk) { // make sure everything went ok ArxDbgUtils::rxErrorMsg(es); delete newBlkRec; newBlkRec = NULL; // don't let caller get bad value } blkTbl->close(); // doesn't need to be open anymore return es;}
开发者ID:FengLuanShuangWu,项目名称:AutoCADPlugin-HeatSource,代码行数:27,
示例8: postToDatabaseAcad::ErrorStatus postToDatabase(/*[in]*/AcDbEntity* pEnt,/*[out]*/AcDbObjectId& idObj)//Purpose:// Adds an entity to the MODEL_SPACE of the CURRENT database.//Note:// It could be generalized to add it to any block table record of// any database, but why complicate it...//{ Acad::ErrorStatus es; AcDbBlockTable* pBlockTable; AcDbBlockTableRecord* pSpaceRecord; AcDbDatabase *pCurDwg = acdbHostApplicationServices()->workingDatabase(); if (pCurDwg==NULL) return Acad::eNoDatabase; //Get a pointer to the current drawing //and get the drawing's block table. Open it for read. if ((es = pCurDwg->getBlockTable(pBlockTable, AcDb::kForRead))==Acad::eOk){ //Get the Model Space record and open it for write. This will be the owner of the new line. if ((es = pBlockTable->getAt(ACDB_MODEL_SPACE, pSpaceRecord, AcDb::kForWrite))==Acad::eOk){ //Append pEnt to Model Space, then close it and the Model Space record. if ((es = pSpaceRecord->appendAcDbEntity(idObj, pEnt))==Acad::eOk) pEnt->close(); pSpaceRecord->close(); } pBlockTable->close(); } //it is good programming practice to return an error status return es;}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:30,
示例9: makeABlockvoidmakeABlock(){ // Create and name a new block table record. // AcDbBlockTableRecord *pBlockTableRec = new AcDbBlockTableRecord(); pBlockTableRec->setName("ASDK-NO-ATTR"); // Get the block table. // AcDbBlockTable *pBlockTable = NULL; acdbHostApplicationServices()->workingDatabase() ->getSymbolTable(pBlockTable, AcDb::kForWrite); // Add the new block table record to the block table. // AcDbObjectId blockTableRecordId; pBlockTable->add(blockTableRecordId, pBlockTableRec); pBlockTable->close(); // Create and add a line entity to the component's // block record. // AcDbLine *pLine = new AcDbLine(); AcDbObjectId lineId; pLine->setStartPoint(AcGePoint3d(3, 3, 0)); pLine->setEndPoint(AcGePoint3d(6, 6, 0)); pLine->setColorIndex(3); pBlockTableRec->appendAcDbEntity(lineId, pLine); pLine->close(); pBlockTableRec->close();}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:35,
示例10: createCircleAcad::ErrorStatus createCircle(AcDbObjectId & idCircle){ CLogger::Print(L"*Call: createCircle()"); Acad::ErrorStatus es, esTmp; AcDbBlockTable* pBlockTable = NULL; es = acdbHostApplicationServices()->workingDatabase() ->getSymbolTable(pBlockTable, AcDb::kForRead); if (Acad::eOk != es) { CLogger::Print(L"*Exit: createCircle() - Fail to get the BlockTable."); return es; } AcDbBlockTableRecord* pModelSpace = NULL; es = pBlockTable->getAt(ACDB_MODEL_SPACE, pModelSpace, AcDb::kForWrite); if (Acad::eOk != (esTmp = pBlockTable->close())) { CLogger::Print(L"Warn: Fail to close the BlockTable!"); acrx_abort(ACRX_T("/nThere is an error occured when close the BlockTable. Message: %s") , acadErrorStatusText(esTmp)); } if (Acad::eOk != es) { CLogger::Print(L"*Exit: createCircle() - Fail to get the Model Space! Error: %s", acadErrorStatusText(es)); return es; } idCircle = AcDbObjectId::kNull; AcGePoint3d pt3Center(9.0, 3.0, 0.0); AcGeVector3d vt3Normal(0.0, 0.0, 1.0); AcDbCircle* pCircle = new AcDbCircle(pt3Center, vt3Normal, 10.0); if (!pCircle) { if (Acad::eOk != (esTmp = pModelSpace->close())) { CLogger::Print(L"Warn: Fail to create new circle object!"); acrx_abort(ACRX_T("/nThere is an error occured. Error: %s") , acadErrorStatusText(esTmp)); } return Acad::eOutOfMemory; } es = pModelSpace->appendAcDbEntity(idCircle, pCircle); if (Acad::eOk != (esTmp = pModelSpace->close())) { CLogger::Print(L"Warn: Fail to close the Model Space!"); acrx_abort(ACRX_T("/nThere is an error occured when close the Model Space! Error: %s") , acadErrorStatusText(esTmp)); } if (Acad::eOk != es) { CLogger::Print(L"*Exit: createCircle() - Fail to append new circle in to Model Space!"); delete pCircle; return es; } if (Acad::eOk != (esTmp = pCircle->close())) { CLogger::Print(L"Warn: Fail to close the circle object."); acrx_abort(ACRX_T("/nFail to close the circle entity!, Error: %s") , acadErrorStatusText(esTmp)); } CLogger::Print(L"*Exit: createCircle()"); return Acad::eOk;}
开发者ID:vuonganh1993,项目名称:arxlss,代码行数:60,
示例11: postToDbAcad::ErrorStatus postToDb(AcDbEntity* ent, AcDbObjectId& objId){ Acad::ErrorStatus es; AcDbBlockTable* pBlockTable; AcDbBlockTableRecord* pSpaceRecord; if ((es = acdbHostApplicationServices()->workingDatabase()-> getSymbolTable(pBlockTable, AcDb::kForRead)) != Acad::eOk) { return es; } if ((es = pBlockTable->getAt(ACDB_MODEL_SPACE, pSpaceRecord, AcDb::kForWrite)) != Acad::eOk) { return es; } if ((es = pBlockTable->close()) != Acad::eOk) { return es; } if ((es = pSpaceRecord->appendAcDbEntity(objId, ent)) != Acad::eOk) { return es; } if ((es = pSpaceRecord->close()) != Acad::eOk) { return es; } return ent->close();}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:34,
示例12: FilterDb//0,不显示属性,1,显示属性,2,显示属性默认值void CZhfPalette::FilterDb(AcDbDatabase* pDb, int iFilterMode){ if (iFilterMode==1) { return ; } Acad::ErrorStatus es ; AcDbBlockTable* pBT = NULL ; pDb->getBlockTable(pBT, AcDb::kForRead); AcDbBlockTableRecord* pBTR = NULL; es = pBT->getAt(ACDB_MODEL_SPACE, pBTR, AcDb::kForWrite); pBT->close(); AcDbBlockTableRecordIterator* pIT; es = pBTR->newIterator(pIT) ; for (; !pIT->done(); pIT->step()) { AcDbEntity* pEnt = NULL ; if (Acad::eOk==pIT->getEntity(pEnt, AcDb::kForWrite)) { if (pEnt->isKindOf(AcDbAttributeDefinition::desc())) { AcDbAttributeDefinition *pAttDef = AcDbAttributeDefinition::cast(pEnt); if (iFilterMode==0) { pEnt->erase() ; } else if (iFilterMode>1) { if (pAttDef != NULL && !pAttDef->isConstant()) { // We have a non-constant attribute definition, // so build an attribute entity. CString strShowVal ; if (iFilterMode==2) { strShowVal = pAttDef->textString() ; } else if (iFilterMode==3) { strShowVal = pAttDef->prompt() ; //显示中文为乱码 } pAttDef->setTag(strShowVal) ; } } } pEnt->close() ; } } delete pIT; pBTR->close();}
开发者ID:luosin,项目名称:cad-2004-lzx,代码行数:56,
示例13: GetBlockTableRecordAcDbBlockTableRecord* CArxHelper::GetBlockTableRecord(AcDbDatabase* pDatabase, BOOL OpenWrite){ AcDbBlockTable* pBlockTable = NULL; pDatabase->getBlockTable(pBlockTable,AcDb::kForRead); AcDbBlockTableRecord* pBTR = NULL; if (pBlockTable) { pBlockTable->getAt(ACDB_MODEL_SPACE, pBTR, OpenWrite ? AcDb::kForWrite : AcDb::kForRead); pBlockTable->close(); } return pBTR;}
开发者ID:ninuo,项目名称:ArxWorkspace,代码行数:12,
示例14: whilevoid InteriorPointsConstructor::printFirstInteriorPoints(int color, bool flag){ int i = 1; int j = 0; AcGePoint3dArray ptArr; ptArr.setLogicalLength(_interiorArray[i].length()+1); while (j < _interiorArray[i].length()) { ptArr[j].set(_interiorArray[i][j].x, _interiorArray[i][j].y, _interiorArray[i][j].z); j++; } ptArr[j].set(_interiorArray[0][0].x, _interiorArray[0][0].y, _interiorArray[0][0].z); AcDb3dPolyline *pNewPline = new AcDb3dPolyline(AcDb::k3dSimplePoly , ptArr, Adesk::kFalse); pNewPline->setColorIndex(color); AcDbBlockTable *pBlockTable; AcDbBlockTableRecord *pBlockTableRecord; acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pBlockTable, AcDb::kForRead); pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForWrite); AcDbObjectId plineObjId; pBlockTableRecord->appendAcDbEntity(plineObjId, pNewPline); pBlockTable->close(); pBlockTableRecord->close(); //pNewPline->setLayer(_T("0")); //pNewPline->setClosed(Adesk::kFalse); pNewPline->close(); //} //delete pNewPline; }
开发者ID:vpatrinica,项目名称:pernute,代码行数:52,
示例15: createPolylinevoidcreatePolyline(){ // Set four vertex locations for the pline. // AcGePoint3dArray ptArr; ptArr.setLogicalLength(4); for (int i = 0; i < 4; i++) { ptArr[i].set((double)(i/2), (double)(i%2), 0.0); } // Dynamically allocate an AcDb2dPolyline object, // given four vertex elements whose locations are supplied // in ptArr. The polyline has no elevation, and is // explicitly set as closed. The polyline is simple; // that is, not curve fit or a spline. By default, the // widths are all 0.0 and there are no bulge factors. // AcDb2dPolyline *pNewPline = new AcDb2dPolyline( AcDb::k2dSimplePoly, ptArr, 0.0, Adesk::kTrue); pNewPline->setColorIndex(3); // Get a pointer to a Block Table object. // AcDbBlockTable *pBlockTable; acdbHostApplicationServices()->workingDatabase() ->getSymbolTable(pBlockTable, AcDb::kForRead); // Get a pointer to the MODEL_SPACE BlockTableRecord. // AcDbBlockTableRecord *pBlockTableRecord; pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForWrite); pBlockTable->close(); // Append the pline object to the database and // obtain its Object ID. // AcDbObjectId plineObjId; pBlockTableRecord->appendAcDbEntity(plineObjId, pNewPline); pBlockTableRecord->close(); // Make the pline object reside on layer "0". // pNewPline->setLayer("0"); pNewPline->close();}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:52,
示例16: GetModelSpaceBlockIDstatic AcDbObjectId GetModelSpaceBlockID (void){ AcDbObjectId ObjectId; AcDbBlockTable * pBlockTable; Acad::ErrorStatus status; status = acdbHostApplicationServices()->workingDatabase()->getBlockTable(pBlockTable, AcDb::kForRead); if (status != Acad::eOk) return false; status = pBlockTable->getAt(ACDB_MODEL_SPACE, ObjectId); pBlockTable->close(); return ObjectId;}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:14,
示例17: acdbCurDwgAcDbObjectId CArxHelper::GetBlockId(const CString& strName){ AcDbBlockTable* pBlockTable = NULL; acdbCurDwg()->getBlockTable(pBlockTable,AcDb::kForRead); AcDbBlockTableRecord* pBTR = NULL; AcDbObjectId blockId = AcDbObjectId::kNull; if (pBlockTable) { pBlockTable->getAt(strName, blockId, AcDb::kForRead); pBlockTable->close(); } return blockId;}
开发者ID:ninuo,项目名称:ArxWorkspace,代码行数:14,
示例18: BlkHasRefbool Additional_Class::BlkHasRef( CString RefName ){ // 判断该名称的块定义是否存在 AcDbBlockTable *pBlkTbl; acdbHostApplicationServices()->workingDatabase()->getBlockTable(pBlkTbl, AcDb::kForWrite); CString strBlkDef; strBlkDef.Format(_T("%s"), RefName); if (pBlkTbl->has(strBlkDef) == true) { pBlkTbl->close(); return true; } pBlkTbl->close(); return false;}
开发者ID:TobeGodman,项目名称:AutoTrader,代码行数:15,
示例19: Draw_TextAcDbObjectId Additional_Class::Draw_Text( CString InputText, AcGePoint3d InsertPoint, double TextHeight, double TextAngle ){ AcDbBlockTable *pBlockTable; AcDbBlockTableRecord *pBlockTableRecord; AcDbText *text_Up = new AcDbText(InsertPoint, InputText, AcDbObjectId::kNull, TextHeight, TextAngle); acdbHostApplicationServices()->workingDatabase()->getBlockTable(pBlockTable, AcDb::kForRead); //this->Open_BlockTable(pBlockTable, NREADMODE); pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForWrite); //this->Open_ModelTableRecord(pBlockTableRecord, pBlockTable, NWRITEMODE); AcDbObjectId TextID; pBlockTableRecord->appendAcDbEntity(TextID, text_Up); text_Up->close(); pBlockTable->close(); pBlockTableRecord->close(); return TextID;}
开发者ID:TobeGodman,项目名称:AutoTrader,代码行数:16,
示例20: insertPointsbool insertPoints(std::map<std::wstring,AcGePoint3d>& m_Points, Adesk::Int16 pointStyle, double pointSize, double textHeight){ AcDbDatabase* pDb = acdbHostApplicationServices()->workingDatabase(); AcCmColor pointColor; AcGePoint3d temp; AcDbPoint* tmp_point = nullptr; AcDbText* tmp_txt = nullptr; AcDbBlockTable* pBT = nullptr; AcDbBlockTableRecord* pBTR = nullptr; ACHAR* nrPct = nullptr; /*****************************************************************/ pointColor.setColorIndex(7); Layer::Create(_T("pctContur"), pointColor, false, false, false); Layer::Create(_T("nrPct"), pointColor, false, false, false); Acad::ErrorStatus es = Acad::eOk; es = acdbHostApplicationServices()->workingDatabase()->setPdmode(pointStyle); es = acdbHostApplicationServices()->workingDatabase()->setPdsize(pointSize); /*****************************************************************/ pDb->getSymbolTable(pBT, AcDb::kForRead); pBT->getAt(ACDB_MODEL_SPACE, pBTR, AcDb::kForWrite); pBT->close(); std::map<std::wstring, AcGePoint3d>::iterator it; for (it = m_Points.begin(); it != m_Points.end();it++) { const wchar_t* key = it->first.c_str(); tmp_point = new AcDbPoint; tmp_point->setPosition(it->second); tmp_point->setLayer(_T("pctContur")); tmp_txt = new AcDbText(it->second, key, AcDbObjectId::kNull, textHeight, 0); tmp_txt->setLayer(_T("nrPct")); pBTR->appendAcDbEntity(tmp_point); pBTR->appendAcDbEntity(tmp_txt); tmp_point->close(); tmp_txt->close(); } pBTR->close(); return true;}
开发者ID:cosmintaran,项目名称:CosminRepo,代码行数:47,
示例21: GetBlockDefinitionByName// 根据块名称获取块定义idstatic AcDbObjectId GetBlockDefinitionByName( const CString& blockName ){ AcDbBlockTable* pBlockTable; acdbHostApplicationServices()->workingDatabase()->getSymbolTable( pBlockTable, AcDb::kForRead ); AcDbBlockTableRecord* pBlockTableRecord; Acad::ErrorStatus es = pBlockTable->getAt( blockName, pBlockTableRecord, AcDb::kForRead ); pBlockTable->close(); AcDbObjectId objId; if( es == Acad::eOk ) { objId = pBlockTableRecord->objectId(); pBlockTableRecord->close(); } return objId;}
开发者ID:kanbang,项目名称:TIDS,代码行数:18,
示例22: normAcDbObjectId Additional_Class::Draw_Circle( AcGePoint3d ptCircle, double Radius ){ AcGeVector3d norm(0,0,1); AcDbCircle *pCircle = new AcDbCircle(ptCircle, norm, Radius); AcDbBlockTable *pBlockTable; AcDbBlockTableRecord *pBlockTableRecord; acdbHostApplicationServices()->workingDatabase()->getBlockTable(pBlockTable, AcDb::kForRead); //Open_BlockTable(pBlockTable, NREADMODE); //Open_ModelTableRecord(pBlockTableRecord, pBlockTable, NWRITEMODE); pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForWrite); AcDbObjectId CircleId; pBlockTableRecord->appendAcDbEntity(CircleId, pCircle); pCircle->close(); pBlockTable->close(); pBlockTableRecord->close(); return CircleId;}
开发者ID:TobeGodman,项目名称:AutoTrader,代码行数:17,
示例23: AppendEntvoid AppendEnt(AcDbEntity *pEnt){ AcDbBlockTable *pBT; AcDbBlockTableRecord *pBTR; acdbHostApplicationServices()->workingDatabase()->getBlockTable(pBT,AcDb::kForRead); pBT->getAt(ACDB_MODEL_SPACE,pBTR,AcDb::kForWrite); pBT->close(); Acad::ErrorStatus es; //add entity to model space es = pBTR->appendAcDbEntity(pEnt); pBTR->close();}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:17,
示例24: acdbOpenAcDbObjectvoidAsdkWblockReactor::otherWblock(AcDbDatabase* pDestDb, AcDbIdMapping& idMap, AcDbDatabase* pSrcDb){ // To find the destination Model Space, you must look // it up in the ID map: AcDbBlockTable *pSrcBlockTable; pSrcDb->getSymbolTable(pSrcBlockTable, AcDb::kForRead); AcDbObjectId srcModelSpaceId; pSrcBlockTable->getAt(ACDB_MODEL_SPACE, srcModelSpaceId); pSrcBlockTable->close(); AcDbIdPair idPair; idPair.setKey(srcModelSpaceId); idMap.compute(idPair); AcDbBlockTableRecord *pDestBTR; acdbOpenAcDbObject((AcDbObject*&)pDestBTR, idPair.value(), AcDb::kForRead, Adesk::kTrue);// END CODE APPEARING IN SDK DOCUMENT. acutPrintf("/nCorrect destination BTR's ObjectId is:/t/t%Ld", pDestBTR->objectId().asOldId()); pDestBTR->close(); // Incorrect way done here so that the wrong value can be // compared to the correct value // AcDbBlockTable *pDestBlockTable; pDestDb->getSymbolTable(pDestBlockTable, AcDb::kForRead); pDestBlockTable->getAt(ACDB_MODEL_SPACE, pDestBTR, AcDb::kForRead); pDestBlockTable->close(); acutPrintf("/nIncorrect destination BTR's ObjectId is /t/t%Ld", pDestBTR->objectId().asOldId()); pDestBTR->close(); // source database Model Space BTR's ObjectId is shown to // demonstrate that this is what the incorrect method gets // pSrcDb->getSymbolTable(pSrcBlockTable, AcDb::kForRead); pSrcBlockTable->getAt(ACDB_MODEL_SPACE, srcModelSpaceId); pSrcBlockTable->close(); acutPrintf("/nSource Database's Model Space BTR's ObjectId is /t%Ld", srcModelSpaceId.asOldId());}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:55,
示例25: addToDatabase// Add the given entity to the current DatabaseAcad::ErrorStatusaddToDatabase(AcDbEntity* pEnt, AcDbObjectId& objId){ Acad::ErrorStatus acadReturnValue = Acad::eOk; AcDbBlockTable* pBlockTable; AcDbBlockTableRecord* pSpaceRecord; AcDbDatabase *pCurDwg = acdbHostApplicationServices()->workingDatabase(); if (pCurDwg==NULL) return Acad::eNoDatabase; if ((acadReturnValue = pCurDwg->getBlockTable(pBlockTable, AcDb::kForRead)) != Acad::eOk) { acutPrintf(ACRX_T("/n acdbCurDwg()->getBlockTable() failed")); return acadReturnValue; } if ((acadReturnValue = pBlockTable->getAt(ACDB_MODEL_SPACE, pSpaceRecord, AcDb::kForWrite)) != Acad::eOk) { acutPrintf(ACRX_T("/n AcDbBlockTable::getAt() failed")); return acadReturnValue; } // close the block table object if ((acadReturnValue = pBlockTable->close()) != Acad::eOk) { acutPrintf(ACRX_T("/n AcDbBlockTable::close() failed")); return acadReturnValue; } // append the entity to the display list if ((acadReturnValue = pSpaceRecord->appendAcDbEntity(objId, pEnt)) != Acad::eOk) { acutPrintf(ACRX_T("/n AcDbBlockTableRecord::appendAcDbEntity() failed")); return acadReturnValue; } // close the block table record object if ((acadReturnValue = pSpaceRecord->close()) != Acad::eOk) { acutPrintf(ACRX_T("/n AcDbBlockTableRecord::close() failed")); return acadReturnValue; } return acadReturnValue;}
开发者ID:Bohr27,项目名称:ObjectARXCore,代码行数:45,
示例26: PostToModelSpaceAcDbObjectId PostToModelSpace(AcDbEntity* pEnt){ AcDbBlockTable *pBlockTable; acdbHostApplicationServices()->workingDatabase() ->getBlockTable(pBlockTable, AcDb::kForRead); AcDbBlockTableRecord *pBlockTableRecord; pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForWrite); AcDbObjectId entId; pBlockTableRecord->appendAcDbEntity(entId, pEnt); pBlockTable->close(); pBlockTableRecord->close(); pEnt->close(); return entId;}
开发者ID:guchanghai,项目名称:Cut,代码行数:19,
示例27: AcDbLineAcDbObjectId Additional_Class::Draw_Line(AcGePoint3d stPoint, AcGePoint3d enPoint){ AcDbLine *pLineTemp = new AcDbLine(); pLineTemp->setStartPoint(stPoint); pLineTemp->setEndPoint(enPoint); AcDbBlockTable *pBlockTable = NULL; acdbHostApplicationServices()->workingDatabase()->getBlockTable(pBlockTable, AcDb::kForRead); //this->Open_BlockTable(pBlockTable, NREADMODE); AcDbBlockTableRecord *pBlockTableRecord = NULL; pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForWrite); //acdbHostApplicationServices()->workingDatabase()->getBlockTable(pBlockTable, AcDb::kForRead); //this->Open_ModelTableRecord(pBlockTableRecord, pBlockTable, NWRITEMODE); AcDbObjectId TempLineID; pBlockTableRecord->appendAcDbEntity(TempLineID, pLineTemp); pLineTemp->close(); pBlockTable->close(); pBlockTableRecord->close(); return TempLineID;}
开发者ID:TobeGodman,项目名称:AutoTrader,代码行数:19,
示例28: addAsdkTextStyleSampObjectvoidaddAsdkTextStyleSampObject(){ AsdkTextStyleSamp *pNewObj = new AsdkTextStyleSamp; AcDbBlockTable *pBlockTable; acdbHostApplicationServices()->workingDatabase() ->getSymbolTable(pBlockTable, AcDb::kForRead); AcDbBlockTableRecord *pBlock; pBlockTable->getAt(ACDB_MODEL_SPACE, pBlock, AcDb::kForWrite); AcDbObjectId objId; pBlock->appendAcDbEntity(objId, pNewObj); pBlockTable->close(); pBlock->close(); pNewObj->close();}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:20,
注:本文中的AcDbBlockTable类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ AcDbBlockTableRecord类代码示例 C++ AbstractVehicle类代码示例 |