- 积分
- 166
- 明经币
- 个
- 注册时间
- 2011-3-4
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
CPoint cpt;
::GetCursorPos(&cpt);
Acad::ErrorStatus status;
AcDbDatabase *pNewDb=NULL;
AcDbDatabase *pDbBack = new AcDbDatabase(Adesk::kFalse);;
status = pDbBack->readDwgFile(filepath);
status = pDbBack->wblock(pNewDb);
AcGePoint3d ptTemp = pDbBack->extmin();
AcGePoint3d ptCurrent(cpt.x,cpt.y,0.0);
AcGeVector3d vecTemp(ptCurrent.x-ptTemp.x, ptCurrent.y-ptTemp.y ,ptCurrent.z-ptTemp.z);
AcGeMatrix3d matrTemp;
matrTemp.setToTranslation(vecTemp);
//matrTemp.setToScaling(0.01);
delete pDbBack;
status = acdbHostApplicationServices()->workingDatabase()->insert(matrTemp, pNewDb);
if (pNewDb)
{
delete pNewDb;
pNewDb = NULL;
}
上面的代码是将一个dwg文件中的模型层实体添加当前的数据库中,并增加位移。
报出溢出的错误。
求解各位大虾分析,跟踪半天了。 |
|