|
void ExpoleBlockEntities(AcDbBlockTableRecord *&pBlockTableRecord,AcDbEntity *pEntity,vector<EntityInfo>& blockIntityVec)
{
AcDbVoidPtrArray entitySet;
Acad::ErrorStatus es = pEntity->explode(entitySet);
if (es != Acad::eOk)
{
acutPrintf(_T("\n炸开块失败"));
}
else
{
for (int i = 0; i < entitySet.length(); i++)
{
AcDbEntity* pEnty = (AcDbEntity*)entitySet.at(i);
if (pEnty != NULL)
{
AcDbObjectId outPutEntId;
Acad::ErrorStatus es = pBlockTableRecord->appendAcDbEntity(outPutEntId,pEnty);//将炸开的实体添加到模型空间中
if(es != Acad::eOk)
{
acutPrintf(_T("\n实体添加到模型空间失败"));
continue;
}
/*
AcDbObjectId objId = pEnty->extensionDictionary();
if(objId == NULL)
{
continue;
}
EntityInfo entityInfo;
entityInfo.handleStr =GetEntityHandleStr(pEnty);
vector<PropertyData> propDataVec;
ACHAR* layerNameChar = pEnty->layer();
CString layerName(layerNameChar);
GetEntityInfo(objId,layerName,propDataVec);
entityInfo.propDataVec.assign(propDataVec.begin(),propDataVec.end());
blockIntityVec.push_back(entityInfo);*/
pEnty->close();
pEnty->erase(TRUE);
}
}
}
} |
|