如何使多义线反向
高手们,请教使多义线反向程序 反向是什么意思,不说明白 <p>先获取多义线的坐标,在由坐标数组的最后一个点对倒过来画线,删除原线.此中法子适用于任何情况.</p><p></p> <p>Option Explicit</p><p>'program to reverse the direction of a pline<br/>'modified from malcolm's codes</p><p>Private Sub reverse_pline(plineObj As Variant)<br/>Dim pts() As Double<br/>Dim bulge() As Double<br/>Dim legs As Integer<br/>Dim retcoord As Variant</p><p>Dim i As Integer<br/>Dim i2 As Integer</p><p>retcoord = plineObj.Coordinates<br/>ReDim Preserve pts(UBound(retcoord))</p><p>legs = (UBound(retcoord) / 2) - 1<br/>ReDim Preserve bulge(legs)</p><p>For i = legs - 1 To 0 Step -1<br/>bulge(i) = plineObj.GetBulge(legs - 1 - i) * -1<br/>Next i</p><p>For i = UBound(retcoord) To 0 Step -2<br/>i2 = UBound(retcoord) - i<br/>pts(i2 + 1) = retcoord(i)<br/>pts(i2) = retcoord(i - 1)<br/>Next i</p><p>plineObj.Coordinates = pts<br/>For i = 0 To legs - 1<br/>plineObj.SetBulge i, bulge(i)<br/>Next i</p><p>End Sub</p><p>Public Sub Test()<br/>Dim polyObj As AcadLWPolyline<br/>Dim ptPicked As Variant<br/>ThisDrawing.Utility.GetEntity polyObj, ptPicked, "Select a LWpolyline: "<br/>reverse_pline polyObj<br/>End Sub</p>请问这程序如何用呀
请问4楼楼主,这程序如何用呀?
页:
[1]