麻烦高手给看看这段程序有什么问题
<p>麻烦高手给看看这段程序有什么问题,我想把一幅地形图的所有符合条件的直线的ENDPOINT修改,也就是向某方向延长这条直线,但延长的方向总不对,为什么?</p><p>On Error Resume Next<br/> <br/>Dim i, n As Long<br/>Dim newObjs As AcadLine<br/>Dim p(2) As Double<br/>Dim iCount As Long, iPoint As Integer</p><p>n = ThisDrawing.ModelSpace.Count</p><p>For i = 0 To n - 1<br/> <br/> If ThisDrawing.ModelSpace.Item(i).Thickness = "6112004" Or ThisDrawing.ModelSpace.Item(i).Thickness = "6320104" Or ThisDrawing.ModelSpace.Item(i).Thickness = "6310004" Then<br/> <br/> Set newObjs = ThisDrawing.ModelSpace.Item(i)<br/> <br/> <br/> X1 = newObjs.startPoint(iCount)<br/> Y1 = newObjs.startPoint(iCount + 1)<br/> z1 = newObjs.startPoint(iCount + 2)<br/> <br/> X2 = newObjs.endPoint(iCount)<br/> Y2 = newObjs.endPoint(iCount + 1)<br/> z2 = newObjs.endPoint(iCount + 2)<br/> <br/> If ThisDrawing.ModelSpace.Item(i).length = "7" Then<br/> <br/> p(0) = (2 * X1 - X2): p(1) = (2 * Y1 - Y2)<br/> <br/> Else<br/> <br/> p(0) = (2 * X2 - X1): p(1) = (2 * Y2 - Y1)<br/> <br/> End If<br/> newObjs.endPoint = p<br/> <br/> newObjs.Update<br/> Else<br/> End If<br/>Next i<br/>ThisDrawing.Regen (True)<br/>MsgBox "修改完毕"</p><p> </p> <p>怎么没人回答啊</p>
页:
[1]