基点を中心にしてオブジェクトを回転させます。
サポートされているプラットフォーム: Windows のみ
VBA:
object.Rotate BasePoint, RotationAngle
タイプ: すべての図形オブジェクト、AttributeReference、Dimension
このメソッドが適用されるオブジェクト。
アクセス: 入力のみ
タイプ: バリアント型(3 要素の倍精度浮動小数点数型配列)
UCS の Z 軸に平行として定義される回転軸が通過する点を指定する 3D WCS 座標。
アクセス: 入力のみ
タイプ: 倍精度浮動小数点数型
オブジェクトを回転させる角度をラジアンで表したもの。この角度は、基点を中心にして、オブジェクトが現在の位置からどれくらい回転するかを決定します。
戻り値はありません。

VBA:
Sub Example_Rotate()
' This example creates a lightweight polyline
' and then rotates that polyline.
' Create the polyline
Dim plineObj As AcadLWPolyline
Dim points(0 To 11) As Double
points(0) = 1: points(1) = 2
points(2) = 1: points(3) = 3
points(4) = 2: points(5) = 3
points(6) = 3: points(7) = 3
points(8) = 4: points(9) = 4
points(10) = 4: points(11) = 2
Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
plineObj.Closed = True
ZoomAll
MsgBox "Rotate the polyline by 45 degrees.", , "Rotate Example"
' Define the rotation
Dim basePoint(0 To 2) As Double
Dim rotationAngle As Double
basePoint(0) = 4: basePoint(1) = 4.25: basePoint(2) = 0
rotationAngle = 0.7853981 ' 45 degrees
' Rotate the polyline
plineObj.Rotate basePoint, rotationAngle
ZoomAll
MsgBox "Rotation completed.", , "Rotate Example"
End Sub
Visual LISP:
(vl-load-com)
(defun c:Example_Rotate()
;; This example creates a lightweight polyline
;; and then rotates that polyline.
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; Create the polyline
(setq points (vlax-make-safearray vlax-vbDouble '(0 . 11)))
(vlax-safearray-fill points '(1 1
1 3
2 3
3 3
4 4
4 2
)
)
(setq modelSpace (vla-get-ModelSpace doc))
(setq plineObj (vla-AddLightWeightPolyline modelSpace points))
(vla-put-Closed plineObj :vlax-true)
(vla-ZoomAll acadObj)
(alert "Rotate the polyline by 45 degrees.")
;; Define the rotation
(setq basePoint (vlax-3d-point 4 4.25 0)
rotationAngle 0.7853981) ;; 45 degrees
;; Rotate the polyline
(vla-Rotate plineObj basePoint rotationAngle)
(vla-ZoomAll acadObj)
(alert "Rotation completed.")
)