leefy 发表于 2005-12-30 22:11:00

二维线的节点问题,附一段程序

各位大侠,在CAD中怎么求出一个闭合二维线节点的个数,用vertex查出来的和用coordinates这个函数算出来的对不上呀.还有就是VERTEX这个属性在VBA中有这个函数吗?我需要的是求出这个闭合的二维线每个节点的坐标,不知道各位大侠有什么更好的办法吗?<br><br>For a = 0 To aa<br>For di = 1 To 100<br>cc = (UBound(ftext.Item(aa - a).Coordinates) + 1) \ 2<br>If cc &lt;&gt; 0 Then<br>ftext.Item(aa - a).color = acRed<br><br>TextBox4.text = cc<br>End If<br>Next<br>Next<br><br>我是做测绘工作的,在实际的工作有许多CAD方面的小问题,楼主是吗?

zhuxuhong 发表于 2005-12-31 08:35:00

<DIV>我也是搞测绘的,你看看这段代码即可</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; allert = GzwObj.Coordinates<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Lbnd = LBound(allert)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ubnd = UBound(allert)</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ReDim points(Lbnd To Ubnd) As Double</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; For i = Lbnd To Ubnd Step 2<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; points(i) = allert(i)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; points(i + 1) = allert(i + 1)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; msg = msg &amp; Format(allert(i + 1), "#####0.000") &amp; "+" &amp; Format(allert(i), "#####0.000") &amp; ","<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Next i<BR></DIV>
<DIV>&nbsp;</DIV>
页: [1]
查看完整版本: 二维线的节点问题,附一段程序