[ARX]求助,版主!程序调不通
我选择了一条pline线,并对其中的点遍历,并把点坐标,导出到一个点数组points()中但我的程序运行完了后,这条线就不能在CAD中编辑,一修改编辑,CAD就自动关闭了!
请版主看一看,谢谢!!!
AcDb2dPolyline* pline2d; <BR> AcDbObjectId objId=AcDbObjectId::kNull;<BR> AcGePoint3d lPt( 0.0, 0.0, 0.0);<BR> int j;j=0;<BR> long sslen;
int result;
ads_name m_ss;<BR> struct resbuf* filter;<BR> result = acedSSGet(_T(":S"), NULL, NULL, NULL, m_ss);<BR> acedSSLength(m_ss, &sslen);
int ret;<BR> ads_name ent;
<BR> for (long i=0L; i<sslen; i++) {<BR> ret = acedSSName(m_ss, i, ent);<BR> ASSERT(ret == RTNORM);<BR> Acad::ErrorStatus es = acdbGetObjectId(objId, ent);<BR> }<BR> AcDbEntity * pEnt;<BR> acdbOpenObject(pEnt,objId,AcDb::kForRead);
AcDb3dPolyline* pline3d;<BR> AcDbPolygonMesh* pmesh;<BR> AcDbPolyFaceMesh* pface;<BR> AcDbPolyline* pline;<BR> AcDbObjectIterator* vertexIter;<BR> Acad::ErrorStatus es;
if ((pline2d = AcDb2dPolyline::cast(pEnt)) != NULL)<BR> vertexIter = pline2d->vertexIterator();<BR> else if ((pline3d = AcDb3dPolyline::cast(pEnt)) != NULL)<BR> vertexIter = pline3d->vertexIterator();<BR> else if ((pmesh = AcDbPolygonMesh::cast(pEnt)) != NULL)<BR> vertexIter = pmesh->vertexIterator();<BR> else if ((pface = AcDbPolyFaceMesh::cast(pEnt)) != NULL)<BR> vertexIter = pface->vertexIterator();<BR> else if ((pline = AcDbPolyline::cast(pEnt)) != NULL)<BR> {<BR> for (unsigned int j=0; j<pline->numVerts(); j++) {<BR> es = pline->getPointAt(j, lPt);<BR> if (es == Acad::eOk) {<BR> points.x=lPt.x;<BR> points.y=lPt.y;<BR> }<BR> }<BR> return j;<BR> }<BR> else<BR> vertexIter = NULL;<BR> pline->close();<BR> pEnt->close();<BR> return 0;
页:
[1]