[求助]帮帮忙看这段代码
<FONT face=宋体 size=2>//2个poly求交,结果错误<BR>Acad::ErrorStatus polyjiao(AcDbObjectId polylineId1,AcDbObjectId polylineId2,AcDbObjectId& polylineId)<BR>{<BR>AcDbObjectId e0Id,e1Id;<BR>AcGeCurve2d *Gpln0;<BR>AcGeCurve2d *Gpln1;<BR>AcGeInterval Ginv0,Ginv1,Ginv2;<BR>//=============================<BR>//选择两条多义线<BR>AcDbPolyline *pent;<BR>acdbOpenObject(pent,polylineId1,AcDb::kForWrite);<BR>convertPolylineToGeCurve(pent,Gpln0);<BR>pent->close();<BR>AcDbPolyline *pent2;<BR>acdbOpenObject(pent2,polylineId2,AcDb::kForWrite);<BR><BR>convertPolylineToGeCurve(pent2,Gpln1);<BR>pent2->close();<BR>Gpln0->getInterval(Ginv0);<BR>double bv0,bv1;<BR>Ginv0.getBounds(bv0,bv1);<BR>ads_printf("\n00:bv0=%f,bv1=%f",bv0,bv1);<BR>Gpln1->getInterval(Ginv1);<BR>Ginv1.getBounds(bv0,bv1);<BR>ads_printf("\n01:bv0=%f,bv1=%f",bv0,bv1);<BR>if(Ginv1.intersectWith(Ginv0,Ginv2)==Adesk::kTrue)<BR>{<BR>ads_printf("\nkTrue");<BR>}<BR><BR>Ginv0.getBounds(bv0,bv1);<BR>ads_printf("\n0:bv0=%f,bv1=%f",bv0,bv1);<BR>Ginv1.getBounds(bv0,bv1);<BR>ads_printf("\n1:bv0=%f,bv1=%f",bv0,bv1);<BR>Ginv2.getBounds(bv0,bv1);<BR>ads_printf("\n2:bv0=%f,bv1=%f",bv0,bv1);<BR>double approxEps=0.001;<BR>AcGePoint2dArray pntArr;<BR>AcGeDoubleArray paramArr;<BR>AcGeDoubleArray *ptayy=new AcGeDoubleArray();<BR>Gpln0->getSamplePoints(bv0,bv1,approxEps,pntArr,paramArr);<BR>ptayy->append(paramArr);<BR>AcGePoint3dArray ptArr;<BR>AcDbObjectId textBoundaryId;<BR>AcGePoint2dArraytoAcGePoint3dArray(pntArr,ptArr);<BR>DrawPolyline(textBoundaryId,ptArr,1,0,TRUE,"0","CONTINUOUS");<BR>return Acad::eOk;<BR>}</FONT> 我是想实现这样的功能http://www.xdcad.net/tech/xd_tbox/xdtb_cboole.swf 大侠帮忙看下
页:
[1]