Creates a mirrored copy of an element about a given plane.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 21.0.0.0 (21.1.1.109)
Since:
2012
Syntax
Visual Basic |
---|
Public Shared Sub MirrorElement ( _
document As Document, _
elementToMirror As ElementId, _
plane As Plane _
) |
Examples
CopyC#
public void MirrorWall(Autodesk.Revit.DB.Document document, Wall wall)
{
Reference reference = HostObjectUtils.GetSideFaces(wall, ShellLayerType.Exterior).First();
Face face = wall.GetGeometryObjectFromReference(reference) as Face;
UV bboxMin = face.GetBoundingBox().Min;
Plane plane = Plane.CreateByNormalAndOrigin(face.ComputeNormal(bboxMin), face.Evaluate(bboxMin).Add(new XYZ(10, 10, 0)));
ElementTransformUtils.MirrorElement(document, wall.Id, plane);
}
CopyVB.NET
Public Sub MirrorWall(document As Autodesk.Revit.DB.Document, wall As Wall)
Dim reference As Reference = HostObjectUtils.GetSideFaces(wall, ShellLayerType.Exterior).First()
Dim face As Face = TryCast(wall.GetGeometryObjectFromReference(reference), Face)
Dim bboxMin As UV = face.GetBoundingBox().Min
Dim plane As Plane = Autodesk.Revit.DB.Plane.CreateByNormalAndOrigin(face.ComputeNormal(bboxMin), face.Evaluate(bboxMin).Add(New XYZ(10, 10, 0)))
ElementTransformUtils.MirrorElement(document, wall.Id, plane)
End Sub
Exceptions
See Also