flaid 发表于 2004-12-4 15:36:00

[求助]帮帮忙看这段代码

<FONT face=宋体 size=2>//2个poly求交,结果错误<BR>Acad::ErrorStatus polyjiao(AcDbObjectId polylineId1,AcDbObjectId polylineId2,AcDbObjectId&amp; 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-&gt;close();<BR>AcDbPolyline *pent2;<BR>acdbOpenObject(pent2,polylineId2,AcDb::kForWrite);<BR><BR>convertPolylineToGeCurve(pent2,Gpln1);<BR>pent2-&gt;close();<BR>Gpln0-&gt;getInterval(Ginv0);<BR>double bv0,bv1;<BR>Ginv0.getBounds(bv0,bv1);<BR>ads_printf("\n00:bv0=%f,bv1=%f",bv0,bv1);<BR>Gpln1-&gt;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-&gt;getSamplePoints(bv0,bv1,approxEps,pntArr,paramArr);<BR>ptayy-&gt;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>

flaid 发表于 2004-12-4 17:31:00

我是想实现这样的功能



http://www.xdcad.net/tech/xd_tbox/xdtb_cboole.swf

flaid 发表于 2004-12-5 13:01:00

大侠帮忙看下
页: [1]
查看完整版本: [求助]帮帮忙看这段代码