Rotates a single object. Rotation is based on the active construction plane.
rhinoscriptsyntax.RotateObject (object_id, center_point, rotation_angle, axis=None, copy=False)
rhinoscript.object.RotateObject (object_id, center_point, rotation_angle, axis=None, copy=False)
object_id |
Required. String or Guid. The identifier of the object to rotate. |
center_point |
Required. List of 3 numbers or Point3d. The 3-D center point of the rotation. |
rotation_angle |
Required. Number. The rotation angle in degrees. |
axis |
Optional. List of 3 numbers, Point3d, or Vector3d. A 3-D vector that identifies the axis of rotation. If omitted, the Z axis of the active construction plane is used as the rotation axis. |
copy |
Optional. Boolean. Copy the object. If omitted, the object will not be copied (False). |
Guid |
The identifier of the rotated object if successful. |
import rhinoscriptsyntax as rs
obj = rs.GetObject("Select object to rotate")
if obj:
point = rs.GetPoint("Center point of rotation")
if point: rs.RotateObject(obj, point, 45.0, None, copy=True)