可以沿指定矢量移动所有图形对象和属性参照对象。 若要移动对象,请使用为该对象提供的方法。此方法需要两个坐标作为输入。这些坐标定义了一个位移矢量,指示给定对象要移动多远以及移动方向。Move 沿矢量移动圆圈本示例创建一个圆,然后沿 X 轴移动该圆两个单位。 Sub Ch4_MoveCircle() ' Create the circle Dim circleObj As AcadCircle Dim center(0 To 2) As Double Dim radius As Double center(0) = 2#: center(1) = 2#: center(2) = 0# radius = 0.5 Set circleObj = ThisDrawing.ModelSpace.AddCircle(center, radius) ZoomAll ' Define the points that make up the move vector. ' The move vector will move the circle 2 units ' along the x axis. Dim point1(0 To 2) As Double Dim point2(0 To 2) As Double point1(0) = 0: point1(1) = 0: point1(2) = 0 point2(0) = 2: point2(1) = 0: point2(2) = 0 ' Move the circle circleObj.Move point1, point2 circleObj.Update End Sub 相关概念父主题: |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:50
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.