- 积分
- 1019
- 明经币
- 个
- 注册时间
- 2003-6-27
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2004-11-8 15:34:00
|
显示全部楼层
本帖最后由 作者 于 2004-11-9 14:03:27 编辑
点的变量就设PT1,PT2等啊!Sub test() ' 定义点1的位置 Dim pointobject As AcadPoint Dim point1(0 To 2) As Double point1(0) = 0: point1(1) = 0: point1(2) = 0 ' 创建点1 Set pointobject = ThisDrawing.ModelSpace.AddPoint(point1)
' 定义点2的位置 Dim pointobject1 As AcadPoint Dim point2(0 To 2) As Double point2(0) = 0: point2(1) = 100: point2(2) = 0 ' 创建点2 Set pointobject1 = ThisDrawing.ModelSpace.AddPoint(point2)
' 定义直线 Dim line As AcadLine ' 创建直线 Set line = ThisDrawing.ModelSpace.AddLine(point1, point2)
' 移动后的点 ' 定义点3的位置 Dim pointobject2 As AcadPoint Dim point3(0 To 2) As Double point3(0) = 0: point3(1) = 200: point3(2) = 0 ' 创建点3 Set pointobject2 = ThisDrawing.ModelSpace.AddPoint(point3)
' 定义点4的位置 Dim pointobject3 As AcadPoint Dim point4(0 To 2) As Double point4(0) = 0: point4(1) = 300: point4(2) = 0 ' 创建点4 Set pointobject3 = ThisDrawing.ModelSpace.AddPoint(point4)
pointobject.Move point1, point3 '改变(移动)点的坐标 pointobject1.Move point2, point4 '改变(移动)点的坐标
line.StartPoint = point3 ' 点的坐标被改变(移动)后线的起始点也跟着改变(移动) line.EndPoint = point4 ' 点的坐标被改变(移动)后线的起始点也跟着改变(移动)
' 缩放试图 ZoomAll
End Sub
请问你要的是这种结果吗? |
|