s5193596 发表于 2010-8-2 20:47:00

请教两个多线段问题

<p>请教两个多线段问题:</p>
<p>&nbsp;&nbsp; 一是如何实现等距等分多线段,得到等分点的坐标。</p>
<p>&nbsp; 二是如何根据已知多线段上的一个点坐标确定它的垂线方向。</p>

wsccmm 发表于 2010-8-3 09:59:00

<p align="left">&nbsp;&nbsp;&nbsp; '&nbsp;定义二维多段线的点</p>
<p align="left">&nbsp;&nbsp;&nbsp; points(0) = 2: points(1) = 4</p>
<p align="left">&nbsp;&nbsp;&nbsp; points(2) = 4: points(3) = 2</p>
<p align="left">&nbsp;&nbsp;&nbsp; points(4) = 6: points(5) = 4</p>
<p align="left">&nbsp;&nbsp;&nbsp; </p>
<p align="left">&nbsp;&nbsp;&nbsp; ' 在模型空间中创建一个优化多段线对象</p>
<p align="left">&nbsp;&nbsp;&nbsp; Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)</p>
<p align="left">&nbsp;</p>
<p align="left">&nbsp;&nbsp;&nbsp; '三等分多段线第一条线段,中间两个点的坐标为:</p>
<p align="left">&nbsp;&nbsp;&nbsp; x1=points(0)+(points(2)-points(0))/3</p>
<p align="left">&nbsp;&nbsp;&nbsp; x2=points(0)+2*(points(2)-points(0))/3</p>
<p align="left">&nbsp;</p>
<p align="left">&nbsp;&nbsp;&nbsp; y1=points(1)+(points(3)-points(1))/3</p>
<p align="left">&nbsp;&nbsp;&nbsp; y2=points(3)+2*(points(3)-points(1))/3</p>
<p align="left">&nbsp;&nbsp;&nbsp;</p>
<p align="left">&nbsp;&nbsp;&nbsp;</p>

s5193596 发表于 2010-8-3 20:56:00

非常感谢楼上的解答,但我想实现的是CAD中等距等分的命令:Measure,而不是等分命令:Divide,请问如何实现?
页: [1]
查看完整版本: 请教两个多线段问题