使用该方法,您可以在 2D 中围绕指定点旋转对象。Rotate 旋转方向由 WCS 确定。该方法在 3D 中围绕指定轴旋转对象。该方法采用三个值作为输入:定义旋转轴的两个点的 WCS 坐标和以弧度为单位的旋转角度。Rotate3DRotate3D 要旋转 3D 对象,请使用任一理论方法。RotateRotate3D 创建一个 3D 框并绕轴旋转它本示例创建一个三维框。然后,它定义要旋转的轴,最后将框绕轴旋转 30 度。 Sub Ch8_Rotate_3DBox() Dim boxObj As Acad3DSolid Dim length As Double Dim width As Double Dim height As Double Dim center(0 To 2) As Double ' Define the box center(0) = 5: center(1) = 5: center(2) = 0 length = 5 width = 7 height = 10 ' Create the box object in model space Set boxObj = ThisDrawing.ModelSpace. _ AddBox(center, length, width, height) ' Define the rotation axis with two points Dim rotatePt1(0 To 2) As Double Dim rotatePt2(0 To 2) As Double Dim rotateAngle As Double rotatePt1(0) = -3: rotatePt1(1) = 4: rotatePt1(2) = 0 rotatePt2(0) = -3: rotatePt2(1) = -4: rotatePt2(2) = 0 rotateAngle = 30 rotateAngle = rotateAngle * 3.141592 / 180# ' Rotate the box boxObj.Rotate3D rotatePt1, rotatePt2, rotateAngle ZoomAll End Sub |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )
GMT+8, 2024-6-10 19:31
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.