[ARX]这段代码为什么老出错?
本帖最后由 作者 于 2006-1-25 0:29:23 编辑 <br /><br /> <P> ads_name entname;<BR> ads_point ptt;<BR> AcDbObjectId entId;<BR> AcDb2dPolyline* pent;<BR> acedEntSel("\n选择多段线",entname,ptt);<BR> acdbOpenObject(pent,entId,AcDb::kForRead);//在这里出错<BR> AcDbObjectIterator* pvertexiter=pent->vertexIterator();//<BR> pent->close();<BR> AcDb2dVertex *pvertex;<BR> AcGePoint3d location;<BR> AcDbObjectId vertexId;</P><P> for(int i=0;!pvertexiter->done();i++,pvertexiter->step())<BR> {<BR> vertexId=pvertexiter->objectId();<BR> acdbOpenObject(pvertex,vertexId,AcDb::kForRead);<BR> location=pvertex->position();<BR> pvertex->close();<BR> acutPrintf("\n 坐标 x=%0.3f,y=%0.3f,z=%0.3f",location,location,location);<BR> }<BR> delete pvertexiter;<BR> 该怎么调试?</P> <P>Acad::ErrorStatus dbStatus = acdbOpenObject(pent,entId,AcDb::kForRead);</P>
<P>在Debug模式下,根据dbStatus的值判断出可能的错误。</P> <P>试试</P>
<P>Acad::ErrorStatus es = acdbOpenAcDbEntity((AcDbEntity *&)pent,entId,AcDb::kForRead);</P> <P>这是那个书上的例子吧,我也遇到了这个问题,也正烦着呢</P>
<P> </P> <P>好像没给entId赋值啊</P>
<P> </P> <P>AcDb2dPolyline* pent;<BR>改成</P>
<P>AcDbPolyline* pent;</P>
页:
[1]