- 积分
- 320
- 明经币
- 个
- 注册时间
- 2004-12-2
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
可以肯定下面代码是能正常运行的,因为在另一个程序运行过, 但是建一个Dialog添加按扭事件,把下面代码粘进去运行就出现未处理的异常,而且应该是 pBlockTableRecord->appendAcDbEntity(pNewPline); 这行出错的。请问是什么原因啊????
就是添加一个多线到图纸中标准例程: AcGePoint3dArray ptArr; ptArr.setLogicalLength(4); for (int i = 0; i < 4; i++) { ptArr.set((double)(i/2), (double)(i%2), 0.0); }
AcDb2dPolyline *pNewPline = new AcDb2dPolyline( AcDb::k2dSimplePoly, ptArr, 0.0, Adesk::kTrue);
pNewPline->setColorIndex(3);
AcDbBlockTable *pBlockTable; acdbHostApplicationServices()->workingDatabase() ->getSymbolTable(pBlockTable, AcDb::kForRead);
AcDbBlockTableRecord *pBlockTableRecord; pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForWrite); pBlockTable->close();
AcDbObjectId plineObjId; pBlockTableRecord->appendAcDbEntity(pNewPline);
pBlockTableRecord->close(); pNewPline->close();
|
|