AutoCAD绘图对象操作与图层管理
1. 绘图对象移动
1.1 移动方法概述
在AutoCAD中,可以使用绘图对象的 Move 方法在模型空间中移动对象。该方法有两个参数,用于定义移动的方向向量,此向量不仅决定了移动方向,还决定了移动的距离。以下是使用 Move 方法移动绘图对象的示例代码:
Const pi = 3.14
Const NumberOfMoves = 200
Dim ShapeObject As AcadShape
Public Sub GetShapeFromFile()
Dim InsertionPoint(0 To 2) As Double
ThisDrawing.LoadShapeFile ("C:/Program Files/ACAD2000/Support/ltypeshp.shx")
InsertionPoint(0) = 1#
InsertionPoint(1) = 1#
InsertionPoint(2) = 0#
Set ShapeObject = ThisDrawing.ModelSpace.AddShape ("box", InsertionPoint, 2#, pi / 2#)
ShapeObject.Update
ZoomAll
MoveShape
End Sub
Public Sub MoveShape()
'moves a shape from a to b in one or more steps
Dim StartPo
超级会员免费看
订阅专栏 解锁全文
1511

被折叠的 条评论
为什么被折叠?



