Revit 2025 API
Element |
Rotates an element about the given axis and angle.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public static void RotateElement( Document document, ElementId elementToRotate, Line axis, double angle )
Public Shared Sub RotateElement ( document As Document, elementToRotate As ElementId, axis As Line, angle As Double )
public: static void RotateElement( Document^ document, ElementId^ elementToRotate, Line^ axis, double angle )
static member RotateElement : document : Document * elementToRotate : ElementId * axis : Line * angle : float -> unit
Parameters

Exception | Condition |
---|---|
ArgumentException | The element elementToRotate does not exist in the document |
ArgumentNullException | A non-optional argument was null |

public void RotateColumn(Autodesk.Revit.DB.Document document, Autodesk.Revit.DB.Element element) { XYZ point1 = new XYZ(10, 20, 0); XYZ point2 = new XYZ(10, 20, 30); Line axis = Line.CreateBound(point1, point2); ElementTransformUtils.RotateElement(document, element.Id, axis, Math.PI / 3.0); }
Public Sub RotateColumn(document As Autodesk.Revit.DB.Document, element As Autodesk.Revit.DB.Element) Dim point1 As New XYZ(10, 20, 0) Dim point2 As New XYZ(10, 20, 30) Dim axis As Line = Line.CreateBound(point1, point2) ElementTransformUtils.RotateElement(document, element.Id, axis, Math.PI / 3.0) End Sub
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also