|
- bool PhdArxBlock::GetAllBlkDefId(AcDbObjectIdArray& arridBlkDef, AcDbDatabase* pDb /*= acdbCurDwg()*/) const
- {
- AcDbBlockTablePointer pBlkTbl(pDb, AcDb::kForRead);
- if (Acad::eOk != pBlkTbl.openStatus())
- return false;
- AcDbBlockTableIterator* pIt = NULL;
- Acad::ErrorStatus es = pBlkTbl->newIterator(pIt);
- if (Acad::eOk != es)
- return false;
- std::unique采用ptr<AcDbBlockTableIterator> apIt(pIt);
- for (apIt->start(); !apIt->done(); apIt->step())
- {
- AcDbBlockTableRecord* pBTRecord = NULL;
- if (apIt->getRecord(pBTRecord, AcDb::kForRead) == Acad::eOk)
- {
- TCHAR* szName = NULL;
- pBTRecord->getName(szName);
- CString BlockName = szName;
- if (采用tcslen(szName) > 0)//过滤掉名称为空的块表;
- {
- if (BlockName.Find(采用T("Model采用Space")) == -1 && BlockName.Find(采用T("Paper采用Space")) == -1)
- arridBlkDef.append(pBTRecord->objectId());
- }
- acutDelString(szName);//必须清除动态字符串;
- pBTRecord->close();
- }
- }
- return true;
- }
复制代码 |
|