ElementTransformUtilsMirrorElement Method |
Creates a mirrored copy of an element about a given plane.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntaxpublic static void MirrorElement(
Document document,
ElementId elementToMirror,
Plane plane
)
Public Shared Sub MirrorElement (
document As Document,
elementToMirror As ElementId,
plane As Plane
)
public:
static void MirrorElement(
Document^ document,
ElementId^ elementToMirror,
Plane^ plane
)
static member MirrorElement :
document : Document *
elementToMirror : ElementId *
plane : Plane -> unit
Parameters
- document Document
-
The document that owns the element.
- elementToMirror ElementId
-
The element to mirror.
- plane Plane
-
The mirror plane.
ExceptionsException | Condition |
---|
ArgumentException |
elementToMirror cannot be mirrored.
-or-
The element elementToMirror does not exist in the document
-or-
The input element is a Sketch member and there is no Sketch in the edit mode to place this element in.
|
ArgumentNullException |
A non-optional argument was null
|
Examplepublic 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);
}
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
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