将几个实体对象变成

首先创建这几个实体的对象 然后创建块定义 再将块定义插入到Dwg中

//添加成块
AcDbBlockTable *pBlkTbl = NULL;
acdbHostApplicationServices()->workingDatabase()->getBlockTable(pBlkTbl, AcDb::kForWrite);
AcDbBlockTableRecord *pBlkTblRcd = new AcDbBlockTableRecord();
pBlkTblRcd->setName(_T("基站工程参数表"));
AcDbObjectId blkDefId;
pBlkTbl->add(blkDefId, pBlkTblRcd);
pBlkTbl->close();
AcDbObjectId entId;
pBlkTblRcd->appendAcDbEntity(entId, pTab);
pBlkTblRcd->appendAcDbEntity(entId, pText);
pText->close();
pTab->close();
pBlkTblRcd->close();
AcDbBlockReference *pBlkRef = new AcDbBlockReference(pInsert2, blkDefId);
AcDbObjectId BlockId = AppendToModelSpace(pBlkRef);

posted @ 2015-10-08 16:50  xzh1993  阅读(207)  评论(0编辑  收藏  举报