|
/ 获得当前所有图层id
static void GetBlockList(AcDbObjectIdArray &BlockIds)
{
AcDbBlockTable *pBlockTbl = NULL;
acdbHostApplicationServices()->workingDatabase()->getBlockTable(pBlockTbl, AcDb::kForRead);
AcDbBlockTablePointer pBlkTbl(acdbCurDwg(), AcDb::kForRead);
AcDbBlockTableIterator *pItr = NULL;
pBlockTbl->newIterator(pItr);
AcDbBlockTableRecord*pBlockTblRcd = NULL;
for (pItr->start();!pItr->done();pItr->step())
{
if (pItr->getRecord(pBlockTblRcd,AcDb::kForRead)==Acad::eOk)
{
BlockIds.append(pBlockTblRcd->objectId());
pBlockTblRcd->close();
}
}
delete pItr;
pBlockTbl->close();
} |
|