shirazbj 发表于 2006-10-31 18:01:00

如何改变直线的端点坐标值呀?

Sub my_changeline_xyz()
   
    Dim UserMessage As String
    Dim ControlPoints As Variant
    Dim iCount As Long, iPoint As Integer
   
    Dim i, n As Long
   
    Dim newObjs As AcadLine
n = ThisDrawing.ModelSpace.Count
   
For i = 0 To n - 1
      
      If ThisDrawing.ModelSpace.Item(i).ObjectName = "AcDbLine" Then
      
         Set newObjs = ThisDrawing.ModelSpace.Item(i)
      
         x1 = newObjs.startPoint(iCount)
         y1 = newObjs.startPoint(iCount + 1)
         z1 = newObjs.startPoint(iCount + 2)
         
         x2 = newObjs.endPoint(iCount)
         y2 = newObjs.endPoint(iCount + 1)
         z2 = newObjs.endPoint(iCount + 2)

      '坐标取出来了,怎么修改呀?
         
      End If
      
         
Next i

MsgBox "Good on ya!"

End Sub

雪山飞狐_lzh 发表于 2006-11-1 12:54:00

dim p1(2) as double,p2(2) as double
p2(0)=10:p2(1)=10
newObjs.startPoint=p1
newObjs.endPoint=p2

shirazbj 发表于 2006-11-4 09:54:00

谢谢。可以改直线了。
我要把在一个平面的图转到另一个与其垂直的平面去。我还要转用其他命令画的图。现在在考虑改polyline的坐标。
页: [1]
查看完整版本: 如何改变直线的端点坐标值呀?