ElementTransformUtilsRotateElement Method |
Rotates an element about the given axis and angle.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 27.0.4.0 (27.0.4.0)
Syntaxpublic 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
- document Document
-
The document that owns the elements.
- elementToRotate ElementId
-
The element to rotate.
- axis Line
-
The axis of rotation.
- angle Double
-
The angle of rotation in radians.
Exceptions
Examplepublic 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);
}
See Also