您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch |

自学教程:C++ AcDbBlockTableRecord类代码示例

51自学网 2021-06-03 12:05:10
  C++
这篇教程C++ AcDbBlockTableRecord类代码示例写得很实用,希望能帮到您。

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

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

示例1: acdbHostApplicationServices

bool Additional_Class::Get_LayerLW( CString LayerName, double &Length, double &Width ){	AcDbLayerTable *pLayerTbl = NULL;	acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pLayerTbl,AcDb::kForRead);	if (!pLayerTbl->has(LayerName))	{		//acutPrintf("/n木有%s层!", LayerName);		//SetError("THERE ISN`T"+LayerName+"LATYER!",  "Get_LayerLW");		pLayerTbl->close();		return false;	}	AcDbObjectId layerId;	pLayerTbl->getAt(LayerName, layerId);	pLayerTbl->close();	AcDbBlockTable *pBlkTbl = NULL;	////获得当前数据库块表	acdbHostApplicationServices()->workingDatabase()->getBlockTable(pBlkTbl,AcDb::kForWrite);	////获得模型空间块表记录	AcDbBlockTableRecord *pBlkTblRcd = NULL;	pBlkTbl->getAt(ACDB_MODEL_SPACE, pBlkTblRcd, AcDb::kForRead);	pBlkTbl->close();	////创建块表记录遍历器	AcDbBlockTableRecordIterator *pltr;	pBlkTblRcd->newIterator(pltr);	AcDbEntity *pEnt;	//AcDbEntityPointer pEnt_Ptr;	////AcDbObjectPointer<AcDbPolyline> pPolyLine_Ptr;	AcDbPolyline *pPolyLine = NULL;	AcDbObjectIdArray PolyLineID_List;	for (pltr->start(); !pltr->done(); pltr->step())	{		pltr->getEntity(pEnt, AcDb::kForRead);	//	//pEnt_Ptr.acquire(pEnt);		if (pEnt->layerId()==layerId)		{			if (pEnt->isKindOf(AcDbPolyline::desc()))			{				pPolyLine = AcDbPolyline::cast(pEnt);				if (pPolyLine != NULL)				{					if (PolyLineIfRectangle(pPolyLine)==true)					{						PolyLineID_List.append(pPolyLine->objectId());					}				}			}		}	}	if (PolyLineID_List.length() >1)	{		acutPrintf(_T("Bom Error 1002/n"));// 有很多矩形		delete pltr;		pEnt->close();		pPolyLine->close();		pBlkTblRcd->close();		return false;	}	////pPolyLine.open(PolyLineID_List[0], AcDb::kForRead);	acdbOpenAcDbEntity(pEnt,PolyLineID_List[0], AcDb::kForRead);	//error!	pPolyLine =  AcDbPolyline::cast(pEnt);	Get_RectangleLW(pPolyLine, Length, Width);	pBlkTblRcd->close();	pPolyLine->close();	pEnt->close();	delete pltr;	return true;}
开发者ID:TobeGodman,项目名称:AutoTrader,代码行数:71,


示例2: Wblock

Acad::ErrorStatus CZhfPalette::Wblock(AcDbDatabase*& pDbFrom, AcDbDatabase*& pDbTo, /*const AcGePoint3d& pt_3d_base,*/ const AcGeMatrix3d & xform){	Acad::ErrorStatus es ;	AcDbObjectIdArray objIdsOut;	AcDbBlockTable* pBT = NULL ;	pDbFrom->getBlockTable(pBT, AcDb::kForRead);	AcDbBlockTableRecord* pBTR = NULL;	es = pBT->getAt(ACDB_MODEL_SPACE, pBTR, AcDb::kForRead);	pBT->close();	AcDbBlockTableRecordIterator* pIT;	es = pBTR->newIterator(pIT) ;	for (; !pIT->done(); pIT->step()) 	{ 		AcDbEntity* pEnt = NULL ;		if (Acad::eOk==pIT->getEntity(pEnt, AcDb::kForRead))		{// 			if (!pEnt->isKindOf(AcDbAttributeDefinition::desc()))// 			{				AcDbObjectId objId;				if (Acad::eOk == pIT->getEntityId(objId))				{					objIdsOut.append(objId);				}// 			}			pEnt->close() ;		}	}	delete pIT;	pBTR->close();	if (!objIdsOut.isEmpty()) 	{		for (int i=0; i<objIdsOut.length(); i++)		{			AcDbObjectId objId = objIdsOut.at(i);			AcDbEntity *pEnt = NULL ;			if(Acad::eOk==acdbOpenAcDbEntity(pEnt,objId, AcDb::kForRead))			{				AcDbObjectId objIdDic ;				if ((objIdDic = pEnt->extensionDictionary())!= AcDbObjectId::kNull)				{					AcDbDictionary *pDict = NULL;									if (Acad::eOk==acdbOpenObject(pDict, objIdDic, AcDb::kForWrite))					{						pDict->setTreatElementsAsHard(Adesk::kTrue);						pDict->close();					}				}				pEnt->close() ;			}		}		AcDbDatabase *pTempDb ;		es = pDbFrom->wblock( pTempDb, objIdsOut, AcGePoint3d::kOrigin ) ;		if (Acad::eOk != es )		{			acedAlert( _T("wblock failed!") );			return es ;		}		es = pDbTo->insert( xform, pTempDb ) ;		if (Acad::eOk != es)			acedAlert( _T("insert failed!" ));		if (pTempDb)		{			delete pTempDb;			pTempDb = NULL ;		}	}	else	{		acutPrintf(_T("/nNo entities found in model space of DWG"));	}	return es ;}
开发者ID:luosin,项目名称:cad-2004-lzx,代码行数:79,


示例3: OnCreateLine

void CMyDlg::OnCreateLine() {		// TODO: Add your control notification handler code here	acDocManager->lockDocument(curDoc());	int i;	int m, n;	char *buf = (char*)malloc(20);		AcDbObjectId LineId;	AcDbLine *pLine = NULL;	//块表	AcDbBlockTable *pTb = NULL;	//块表记录	AcDbBlockTableRecord *pTbr = NULL;	//层表	AcDbLayerTable *pLyr = NULL;	//层表记录	AcDbLayerTableRecord* pLyrr = NULL;	//图形数据库	AcDbDatabase *pDb = acdbHostApplicationServices()->workingDatabase();		Acad::ErrorStatus es;		CListCtrl *pListCtr = (CListCtrl *)GetDlgItem( IDC_LIST1 );		//设置随机数种子	srand(time(NULL));		//更新数据	UpdateData(TRUE);	m_VecSize += m_Edit5;	m_xVec.resize(m_VecSize);	m_yVec.resize(m_VecSize);	//acutPrintf("%d/n", m_Edit1);		es = pDb->getLayerTable(pLyr, AcDb::kForWrite);	//以写的方式打开层表	es = pDb->getBlockTable(pTb, AcDb::kForRead);	//以读的方式打开块表	es = pTb->getAt(ACDB_MODEL_SPACE, pTbr, AcDb::kForWrite);//以写的方式打开块表记录		//创建图层GalLineTest	if (!pLyr->has("GalLineTest"))	{		pLyrr = new AcDbLayerTableRecord;	//创建层记录		pLyrr->setName("GalLineTest");		//设置名字		//pLyrr->setColor(color);			//设置颜色		//pLyrr->setLineWeight(lnWt);		//设置线宽				if (Acad::eOk != pLyr->add(pLyrr))	//添加该层记录到层表		{			//添加失败			delete pLyrr;		//释放内存			pLyr->close();		//关闭层表		}		//关闭层表记录		pLyrr->close();	}	//关闭层表	pLyr->close();		//生成点坐标	for (i = 0; i < m_Edit5; ++i)	{		if ((m_Edit2 != 0) && (m_Edit4 != 0))		{			m_xVec[i] = rand() % m_Edit2 + m_Edit1;			m_yVec[i] = rand() % m_Edit4 + m_Edit3;		}		else		{			m_xVec[i] = 0;			m_yVec[i] = 0;		}	}		//遍历点坐标	for (m = 0; m < m_Edit5; ++m)	{		for (n = (m+1); n < m_Edit5; ++n)		{			if ((m_xVec[m] != m_xVec[n]) && (m_yVec[m] != m_yVec[n]))			{				AcGePoint3d ptStart(m_xVec[m], m_yVec[m], 0);				AcGePoint3d ptEnd(m_xVec[n], m_yVec[n], 0);				pLine = new AcDbLine(ptStart, ptEnd);				//pLine->setColor();				pLine->setLayer("GalLineTest");				//创建线段				es = pTbr->appendAcDbEntity(LineId, pLine);				if (Acad::eOk == es)				{					++m_lLineCnt;				}				//acutPrintf("%d/n", LineId);				sprintf(buf, "%d", LineId);							m_ListCtr.InsertItem(m_Row, buf);				//.........这里部分代码省略.........
开发者ID:trist725,项目名称:GalCreateLines,代码行数:101,


示例4: bool

bool Additional_Class::LaylerFilter( CString LaylerName, AcDbObjectIdArray &EntityID_Array, bool(*Filter)(AcDbEntity*, AcDbObjectId&) ){	AcDbLayerTable *pLayerTbl;	acdbHostApplicationServices()->workingDatabase()->getLayerTable(pLayerTbl,AcDb::kForWrite);	if (false == (pLayerTbl->has(LaylerName)))	{		//acutPrintf("/n木有%s层!", LaylerName);		//SetError("THERE ISTN`T"+LaylerName+"LAYER!", "LaylerFilter");		pLayerTbl->close();		return false;	}	AcDbObjectId layerId;	pLayerTbl->getAt(LaylerName,layerId);	AcDbBlockTable *pBlkTbl;	//获得当前数据库块表	acdbHostApplicationServices()->workingDatabase()->getBlockTable(pBlkTbl,AcDb::kForWrite);		//获得模型空间块表记录	AcDbBlockTableRecord *pBlkTblRcd;	pBlkTbl->getAt(ACDB_MODEL_SPACE, pBlkTblRcd, AcDb::kForWrite);	//创建块表记录遍历器	AcDbBlockTableRecordIterator *pltr;	pBlkTblRcd->newIterator(pltr);	AcDbEntity *pEnt;	AcDbObjectId temp_layerId;	AcDbObjectId entityID;	//pBlkTblRcd->close();	//pBlkTbl->close();	//pLayerTbl->close();	for (pltr->start(); !pltr->done(); pltr->step())	{		if(Acad::eOk ==pltr->getEntity(pEnt, AcDb::kForRead, false))		{			//if (200>Check_Entity(pEnt)>=100)			//{			temp_layerId = pEnt->layerId();			if (temp_layerId == layerId)		// 在当前图层中			{				entityID = pEnt->objectId();				if (Filter(pEnt, entityID) == true)  // 符合过滤条件				{					EntityID_Array.append(entityID);				}			}			//}			pEnt->close();		}	}	int Len = EntityID_Array.length();	if (Len == 0)	{		pBlkTbl->close();		pLayerTbl->close();		pBlkTblRcd->close();		return false;	}	pBlkTbl->close();	pLayerTbl->close();	pBlkTblRcd->close();	return true;}
开发者ID:TobeGodman,项目名称:AutoTrader,代码行数:64,


示例5: dbox

Acad::ErrorStatusArxDbgDbEntity::deepClone(AcDbObject* pOwner,              AcDbObject*& pClonedObject,              AcDbIdMapping& idMap,              Adesk::Boolean isPrimary) const{        // You should always pass back pClonedObject == NULL        // if, for any reason, you do not actually clone it        // during this call.  The caller should pass it in        // as NULL, but to be safe, we set it here as well.    pClonedObject = NULL;	if (ArxDbgOptions::m_instance.m_showDeepCloneDetails) {		CString titleStr, tmpStr;		titleStr.Format(_T("Beginning -- deepClone: %s"),				ArxDbgUtils::objToClassAndHandleStr(const_cast<ArxDbgDbEntity*>(this), tmpStr));		ArxDbgUiTdmIdMap dbox(&idMap, acedGetAcadDwgView(), titleStr);		dbox.DoModal();	}    AcDb::DeepCloneType type = idMap.deepCloneContext();        // if we know everything will be cloned for us, just let		// the base class do everything for us.    if ((type == AcDb::kDcInsert) ||		(type == AcDb::kDcInsertCopy) ||		(type == AcDb::kDcExplode))        return AcDbEntity::deepClone(pOwner, pClonedObject, idMap, isPrimary);        // following case happens when doing a AcDbDatabase::deepCloneObjects()        // and the owner happens to be the same... then its really like a        // kDcCopy, otherwise deepCloneObjects() is like a kDcBlock    if (type == AcDb::kDcObjects) {		if (ownerId() == pOwner->objectId())			type = AcDb::kDcCopy;		else			type = AcDb::kDcBlock;	}		// now ask derived classes what references they want cloned for them	AcDbObjectIdArray refEntIds;	AcDbIntArray refTypes;	getCloneReferences(type, refEntIds, refTypes);	ASSERT(refEntIds.length() == refTypes.length());		// if derived class doesn't have any references to take care of, then		// we will just let the AcDbEntity::deepClone() take care of things.	if (refEntIds.isEmpty())		return AcDbEntity::deepClone(pOwner, pClonedObject, idMap, isPrimary);        // If this object is in the idMap and is already        // cloned, then return.	bool tmpIsPrimary = isPrimary ? true : false;	// get around compiler performance warning    AcDbIdPair idPair(objectId(), AcDbObjectId::kNull, false, tmpIsPrimary);    if (idMap.compute(idPair) && (idPair.value() != NULL))        return Acad::eOk;    // STEP 1:    // Create the clone    //    AcDbObject *pClone = (AcDbObject*)isA()->create();    if (pClone != NULL)        pClonedObject = pClone;    // set the return value    else        return Acad::eOutOfMemory;    // STEP 2:    // Append the clone to its new owner.  In this example,    // we know that we are derived from AcDbEntity, so we    // can expect our owner to be an AcDbBlockTableRecord,    // unless we have set up an ownership relationship with    // another of our objects.  In that case, we need to    // establish how we connect to that owner in our own    // way.  This sample shows a generic method using    // setOwnerId().    //    AcDbBlockTableRecord *pBTR = AcDbBlockTableRecord::cast(pOwner);    if (pBTR != NULL) {        AcDbEntity* ent = AcDbEntity::cast(pClone);        pBTR->appendAcDbEntity(ent);    }    else {        if (isPrimary)            return Acad::eInvalidOwnerObject;        // Some form of this code is only necessary if        // anyone has set up an ownership for our object        // other than with an AcDbBlockTableRecord.        //        pOwner->database()->addAcDbObject(pClone);        pClone->setOwnerId(pOwner->objectId());    }    // STEP 3:    // Now we copy our contents to the clone.  This is done    // using an AcDbDeepCloneFiler.  This filer keeps a    // list of all AcDbHardOwnershipIds and    // AcDbSoftOwnershipIds we, and any classes we derive    // from,  have.  This list is then used to know what    // additional, "owned" objects need to be cloned below.//.........这里部分代码省略.........
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:101,


示例6: while

void InteriorPointsConstructor::printInteriorPoints(int color, bool flag){	int i = 0;		while (i < _contourArray->length()/2 + 1)	{		int j = 0;						AcGePoint3dArray ptArr;		if ((flag)|| (_interiorArray[i].length() <2)) ptArr.setLogicalLength(_interiorArray[i].length());		else  ptArr.setLogicalLength(_interiorArray[i].length()-1);				if ((flag)|| (_interiorArray[i].length() < 2))		while (j < _interiorArray[i].length())		{						ptArr[j].set(_interiorArray[i][j].x, _interiorArray[i][j].y, _interiorArray[i][j].z);								j++;		}		else		{				while (j < _interiorArray[i].length()-2)				{									ptArr[j].set(_interiorArray[i][j].x, _interiorArray[i][j].y, _interiorArray[i][j].z);						if (sqrt(_interiorArray[i][j].x*_interiorArray[i][j].x + _interiorArray[i][j].y*_interiorArray[i][j].y + _interiorArray[i][j].z*_interiorArray[i][j].z) < 100)							acutPrintf(_T("The shitty: %d, %d/n"), i, j);						j++;				}				j++;				ptArr[j].set(_interiorArray[i][j].x, _interiorArray[i][j].y, _interiorArray[i][j].z);					}		//if (i == 10){		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;				i++;	}}
开发者ID:vpatrinica,项目名称:pernute,代码行数:73,


示例7: refEditApiExample

voidrefEditApiExample(){    AcDbObjectId transId;    AcDbDatabase* pDb;    char *fname;    struct resbuf *rb;    // Get a dwg file from the user.    //    rb = acutNewRb(RTSTR);    int stat = acedGetFileD("Pick a drawing", NULL, "dwg", 0, rb);        if ((stat != RTNORM) || (rb == NULL)) {        acutPrintf("/nYou must pick a drawing file.");        return;    }    fname = (char*)acad_malloc(strlen(rb->resval.rstring) + 1);    strcpy(fname, rb->resval.rstring);    acutRelRb(rb);        // Open the dwg file.    //    pDb = new AcDbDatabase(Adesk::kFalse);    if (pDb->readDwgFile(fname) != Acad::eOk) {        acutPrintf("/nSorry, that draing is probably already open.");        return;    }    // Get the Block Table and then the model space record.    //    AcDbBlockTable *pBlockTable;    pDb->getSymbolTable(pBlockTable, AcDb::kForRead);    AcDbBlockTableRecord *pOtherMsBtr;    pBlockTable->getAt(ACDB_MODEL_SPACE, pOtherMsBtr, AcDb::kForRead);    pBlockTable->close();    // Create an iterator.    //    AcDbBlockTableRecordIterator *pIter;    pOtherMsBtr->newIterator(pIter);    // Set up an object ID array.    //    AcDbObjectIdArray objIdArray;    // Iterate over the model space BTR. Look specifically     // for lines and append their object ID to the array.    //    for (pIter->start(); !pIter->done(); pIter->step()) {        AcDbEntity *pEntity;        pIter->getEntity(pEntity, AcDb::kForRead);        // Look for only AcDbLine objects and add them to the         // object ID array.        //        if (pEntity->isKindOf(AcDbLine::desc())) {            objIdArray.append(pEntity->objectId());        }        pEntity->close();    }    delete pIter;    pOtherMsBtr->close();    if (objIdArray.isEmpty()) {        acad_free(fname);        acutPrintf("/nYou must pick a drawing file that contains lines.");        return;    }    // Now get the current database and the object ID for the    // current database's model space BTR.    //    AcDbBlockTable *pThisBlockTable;    acdbHostApplicationServices()->workingDatabase()        ->getSymbolTable(pThisBlockTable, AcDb::kForRead);    AcDbBlockTableRecord *pThisMsBtr;    pThisBlockTable->getAt(ACDB_MODEL_SPACE, pThisMsBtr, AcDb::kForWrite);    pThisBlockTable->close();        AcDbObjectId id = pThisMsBtr->objectId();    pThisMsBtr->close();    // Create the long transaction. This will check all the entities     // out of the external database.    //    AcDbIdMapping errorMap;    acapLongTransactionManagerPtr()->checkOut(transId, objIdArray, id, errorMap);    // Now modify the color of these entities.    //    int colorIndex;    acedGetInt("/nEnter color number to change entities to: ", &colorIndex);    AcDbObject* pObj;    if (acdbOpenObject(pObj, transId, AcDb::kForRead) == Acad::eOk) {//.........这里部分代码省略.........
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:101,


示例8: customAlignmentDraw

//---------------------------------------------------------------------------------------////  功能: 路线绘制回调函数////  输入参数://             AeccDisplayOrientation &viewMode//             IAeccAlignment *pAlign//             IAcadBlock *pAnonymousBlock ////  返回值:bool//// 作  者:  ////  日期: 2007/08////  修改记录:无////---------------------------------------------------------------------------------------bool customAlignmentDraw(const AeccDisplayOrientation &viewMode, IAeccAlignment *pAlign,						 IAcadBlock *pAnonymousBlock ){	AcDbBlockTableRecord* blkRec;	CString strName;	CComBSTR bstrName;	pAnonymousBlock->get_Name( &bstrName);	strName = bstrName;	AcDbBlockTable* blkTbl;	AcDbDatabase* pDb = acdbCurDwg();	Acad::ErrorStatus es = pDb->getSymbolTable(blkTbl, AcDb::kForRead);	if (es != Acad::eOk){		return false;	}	//// open named block	es = blkTbl->getAt(strName, blkRec, AcDb::kForWrite);	acutPrintf(_T("/nget block"));	if (es != Acad::eOk) {		blkTbl->close();    // doesn't need to be open anymore		return false;	}	blkTbl->close();    // doesn't need to be open anymore	CComQIPtr <IAeccAlignmentEntities> pAlignEntities;	CComQIPtr <IAeccAlignmentEntity> pAlignEnt;	CComQIPtr<IAeccAlignmentArc> pAlignArc;	long iCount;	pAlign->get_Entities(&pAlignEntities);	if (pAlignEntities != NULL) {		pAlignEntities->get_Count(&iCount);		for (long i = 0; i < iCount; i++) {			pAlignEnt.Release();			pAlignEntities->Item(_variant_t(i), &pAlignEnt);			pAlignArc.Release();			pAlignArc = pAlignEnt;			if (pAlignArc != NULL) {				double radius;				pAlignArc->get_Radius(&radius);				//acutPrintf(_T("/nRadius: %f", radius));				if (radius < 200) {					double x;					double y;					double dStart;					double dEnd;					pAlignArc->get_StartingStation(&dStart);					pAlignArc->get_EndingStation(&dEnd);					for (double delta = dStart; delta < dEnd; delta += 3.0) {						pAlign->PointLocation(delta, 0.0, &x, &y);						AcGePoint3d pt(x,y,0);						AcDbCircle* cir = new AcDbCircle(pt, AcGeVector3d::kZAxis, 5.0);						cir->setColorIndex (1, Adesk::kTrue);						blkRec->appendAcDbEntity(cir);						cir->close();					}				}			}		}	}	blkRec->close();	return (true) ;}
开发者ID:guchanghai,项目名称:Cut,代码行数:84,


示例9: BlockToEntity

static void BlockToEntity( const AcDbObjectId& blkId, const AcGeMatrix3d& blkXform,                           const AcStringArray& names, const AcStringArray& attValues,                           AcGeVoidPointerArray& ents ){    // 将块定义分解成独立的图元    // 将属性替换成多行文字    AcTransaction* pTrans = actrTransactionManager->startTransaction();    AcDbObject* pObj;    if( Acad::eOk != pTrans->getObject( pObj, blkId, AcDb::kForRead ) )    {        actrTransactionManager->abortTransaction();        return;    }    AcDbBlockTableRecord* pBTR = AcDbBlockTableRecord::cast( pObj );    // BUG:不能调用hasAttributeDefinitions()方法    // 调用之后,如果没有在块编辑器中对块进行修改,    // 那么进行移动、夹点编辑等操作,没有动态显示效果    //if(!pBTR->hasAttributeDefinitions())    //{    //	// 没有属性定义    //	acutPrintf(_T("/n没有属性定义"));    //	actrTransactionManager->abortTransaction();    //	return;    //}    AcDbBlockTableRecordIterator* pIterator;    if( Acad::eOk != pBTR->newIterator( pIterator ) )    {        actrTransactionManager->abortTransaction();        return;    }    // 遍历块中的图元,查找AcDbAttributeDefinition    for( pIterator->start( true ); !pIterator->done(); pIterator->step( true ) )    {        AcDbObjectId objId;        if( Acad::eOk != pIterator->getEntityId( objId ) ) continue;        if( Acad::eOk != pTrans->getObject( pObj, objId, AcDb::kForWrite ) ) continue;        AcDbEntity* pEnt = AcDbEntity::cast( pObj );        if( !pEnt->isKindOf( AcDbAttributeDefinition::desc() ) )        {            AcDbEntity* pClone = AcDbEntity::cast( pEnt->clone() );            pClone->transformBy( blkXform );            // 添加到实体集合            ents.append( pClone );        }        else        {            AcDbAttributeDefinition* pAttDef = AcDbAttributeDefinition::cast( pEnt );            pAttDef->convertIntoMTextAttributeDefinition( Adesk::kTrue );            // 获取标签名称            ACHAR* pTag = pAttDef->tag();            int pos = names.find( pTag );            if( pos != -1 )            {                // 获取多行文本对象                AcDbMText* pMText = pAttDef->getMTextAttributeDefinition();                pMText->transformBy( blkXform );                pMText->setContents( attValues[pos].kACharPtr() );                // 添加到实体集合                ents.append( pMText );            }            acutDelString( pTag );        }    }    delete pIterator;    actrTransactionManager->endTransaction();}
开发者ID:kanbang,项目名称:TIDS,代码行数:71,


示例10: generateInventarTable

void generateInventarTable(std::map<std::wstring, AcGePoint3d>& m_points, double textHeight){	Acad::ErrorStatus es;	AcGePoint3d insertionPoint;	AcDbObjectId objectID;	AcDbTable* pTable = nullptr;	AcDbDictionary* pDic = nullptr;	AcDbBlockTable* pBT = nullptr;	AcDbBlockTableRecord* pBTR = nullptr;	AcDbDatabase*pDb = nullptr;	u_int nrRows = m_points.size() + 2;	double headerHeight = textHeight + ((textHeight * HEADERPERCENT) / 100);	double titleHeight = textHeight + ((textHeight * TITLEPERCENT) / 100);	double nrpctWidth = 0.0;	int ret = acedGetPoint(NULL, _T("/nSelecteaza punctul de insertie al tabelului "), asDblArray(insertionPoint));		AcDbObjectId textID = Utils::NewTextStyle(_T("TableStyle"), titleHeight);	pDb = acdbHostApplicationServices()->workingDatabase();	pBTR = new AcDbBlockTableRecord;	pDb->getSymbolTable(pBT, AcDb::kForRead);	pBT->getAt(ACDB_MODEL_SPACE, pBTR, AcDb::kForWrite);	pBT->close();	es = pDb->getTableStyleDictionary(pDic, AcDb::kForWrite);	es = pDic->getAt(_T("Standard"), objectID); 	es = pDic->close();	pTable = new AcDbTable;	pTable->setTableStyle(objectID);		pTable->setSize(nrRows, NUM_COL);	pTable->setAlignment(AcDb::kMiddleCenter);	pTable->setTextHeight( titleHeight,AcDb::kTitleRow);	pTable->setTextHeight(headerHeight, AcDb::kHeaderRow);	pTable->setTextHeight(textHeight, AcDb::kDataRow);	//pTable->setTextStyle(objectID);		pTable->setTextStyle(0, 0, textID);	pTable->setTextString(0, 0, _T("Inventar de coordonate"));	double tableWidth = Utils::GetTextWidth(_T("[email
C++ AcDbDatabase类代码示例
C++ AcDbBlockTable类代码示例
51自学网,即我要自学网,自学EXCEL、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。
京ICP备13026421号-1