- UID
- 121460
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2004-4-5
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
void AppendToModelSpace(AcDbDatabase *pDbNew,AcDbEntity* pEnt,AcDbObjectId &objId)
{
AcDbBlockTable *pBlkTbl;
AcDbBlockTableRecord *pBlkTblRcd;
pDbNew->getSymbolTable(pBlkTbl, AcDb::kForRead);
pBlkTbl->getAt(ACDB_MODEL_SPACE, pBlkTblRcd,
AcDb::kForWrite);
pBlkTblRcd->appendAcDbEntity(objId, pEnt);
((AcDbObject *)pEnt)->downgradeOpen();
pBlkTbl->close();
pBlkTblRcd->close();
return;
}
void ExplodeBlock()
{
AcDbVoidPtrArray *vparr;
AcDbObject * pDbO=NULL;
AcDbObjectId DbOId=NULL;
vparr = new AcDbVoidPtrArray();
ads_name ss,se;
struct resbuf * preb;
AcDbDatabase *pdbD = acdbHostApplicationServices()->workingDatabase();
preb = acutBuildList(RTDXF0,"INSERT",0);
acedSSGet("X", NULL, NULL, preb, ss);
acutRelRb(preb);
long lLen = 0;
acedSSLength(ss,&lLen);
for (int i = 0; i < lLen; i++) {
acedSSName(ss, i, se);
acdbGetObjectId(DbOId, se);
acdbOpenObject(pDbO, DbOId, AcDb::kForWrite);
((AcDbEntity *)pDbO)->explode(*vparr);
((AcDbEntity *)pDbO)->layer();
pDbO->close();
for(int j = 0; j < vparr->length(); j++){
pDbO = (AcDbEntity *)vparr->at(j);
AppendToModelSpace(pdbD, (AcDbEntity *)vparr->at(j), DbOId);
pDbO->close();
}
vparr->removeSubArray(0, vparr->length());
}
delete vparr;
} |
|