- UID
- 289007
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2005-7-6
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
功能就是遍历整个块表,找到颜色索引为100的实体,然后用改实体跟整个块表中其他的实体进行布尔差运算,然后把最终的实体添加到块表中。程序如下:
AcDbBlockTable *pThisBlockTable;
acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pThisBlockTable,
AcDb::kForWrite);
AcDbBlockTableRecord *pOtherBtr;
pThisBlockTable->getAt(ACDB_MODEL_SPACE,pOtherBtr,AcDb::kForWrite);
pThisBlockTable->close();
AcDbBlockTableRecordIterator *pOIter,*Iter;
AcDbEntity *mpipe;
AcDb3dSolid *ZSolid;
AcDbObjectId ZSolidId,mpipeId;
pOtherBtr->newIterator(pOIter);
for(pOIter->start();!pOIter->done();pOIter->step())
{
AcDbEntity *ent;
pOIter->getEntity(ent,AcDb::kForWrite);
if(ent->colorIndex()==100)
mpipeId=ent->objectId();
ent->close();
}
delete pOIter;
pOtherBtr->close();
acdbOpenObject(mpipe,mpipeId,AcDb::kForWrite);
ZSolid=(AcDb3dSolid *)mpipe;
mpipe->close();
pOtherBtr->newIterator(Iter);
for(Iter->start();!Iter->done();Iter->step())
{
AcDbEntity *mainp;
Iter->getEntity(mainp,AcDb::kForWrite);
if(mainp->colorIndex()!=100)
{
ZSolid->booleanOper(AcDb::kBoolSubtract,(AcDb3dSolid *)mainp);
}
mainp->close();
}
pOtherBtr->appendAcDbEntity(ZSolidId,ZSolid);
ZSolid->close();
delete Iter;
pOtherBtr->close();
但是我每次运行到第二个遍历就会出现下面的问题:内部错误:!U:\global\src\coreacad\CORESRC\scandr.cpp@773:eWaoOpenForWrite,然后CAD就自动关闭了,这是哪里出错了?应该怎么改? |
|