[求助]请教这是为什么?
void AdeskCreateDim()<BR>{<BR> AcGePoint3d pt1(0,0,0),pt2(10,0,0),pt3(5,5,0);<BR> AcDbRotatedDimension *pDim=new AcDbRotatedDimension(0,pt1,pt2,pt3);<BR> Acad::ErrorStatus es ;<BR> AcDbBlockTable *pBlockTbl ;<BR> AcDbBlockTableRecord *pBlkTblRec;<BR> if ( (es =acdbHostApplicationServices ()->workingDatabase ()->getBlockTable (pBlockTbl, AcDb::kForRead)) != Acad::eOk )<BR> {<BR> acutPrintf ("\nCouldn't open the block table!") ;<BR> return;<BR> }<BR> if ( (es =pBlockTbl->getAt (ACDB_MODEL_SPACE, pBlkTblRec, AcDb::kForWrite)) != Acad::eOk ) <BR> {<BR> acutPrintf ("\nCouldn't get Model Space! Drawing corrupt.\n") ;<BR> pBlockTbl->close () ;<BR> return;<BR> }<BR> if ( (es =pBlkTblRec->appendAcDbEntity (pDim)) != Acad::eOk ) <BR> {<BR> delete pDim ;<BR> pBlkTblRec->erase () ;<BR> pBlkTblRec->close () ;<BR> return;<BR> }<BR> pDim->close();<BR> pBlkTblRec->close();<BR>}<BR>在Acad中键入命令createdim,出现如下提示:<BR>Regen terminated<BR>键入命令"x"->"all"则标注显示在屏幕上.<BR>请教这是为什么? if ( (es =pBlkTblRec->appendAcDbEntity (pDim)) != Acad::eOk ) <BR> {<BR> delete pDim ;<BR> pBlkTblRec->erase () ;<BR> <FONT color=#ff0000>pBlkTblRec->close () ;<BR></FONT> return;<BR> }<BR> pDim->close();<BR> <FONT color=#ff0000>pBlkTblRec->close();</FONT><BR>}这两个地方(直接造成问题的是后一个地方)你只关了block table record, 没有关block table, 所以ACAD就暴走了.<BR> 谢谢啦!
页:
[1]