- 积分
- 90324
- 明经币
- 个
- 注册时间
- 2005-3-31
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2013-9-30 16:58:40
|
显示全部楼层
//对象添加到模型空间
Acad::ErrorStatus PostToModelSpace( AcDbEntity* pEnt)
{
Acad::ErrorStatus es;
AcDbObjectId entId;
AcDbBlockTable *pBlockTable;
es = acdbHostApplicationServices()->workingDatabase()
->getBlockTable(pBlockTable, AcDb::kForRead);
if (es != Acad::eOk)
{
pBlockTable->close();
pEnt->close();
return es;
}
AcDbBlockTableRecord *pBlockTableRecord;
es = pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord,AcDb::kForWrite);
if (es != Acad::eOk)
{
pBlockTable->close();
pBlockTableRecord->close();
pEnt->close();
return es;
}
es = pBlockTableRecord->appendAcDbEntity(entId, pEnt);
pBlockTable->close();
pBlockTableRecord->close();
pEnt->close();
return es;
}
|
|