ElementTransformUtils.MirrorElement
Description:
Creates a mirrored copy of an element about a given plane.
Creates a mirrored copy of an element about a given plane.
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; // get one of the wall's major side faces
UV bboxMin = face.GetBoundingBox().Min;
Plane plane = Plane.CreateByNormalAndOrigin(face.ComputeNormal(bboxMin), face.Evaluate(bboxMin).Add(new XYZ(10, 10, 0)));
// create a plane based on this side face with an offset of 10 in the X & Y directions
ElementTransformUtils.MirrorElement(document, wall.Id, plane);
}
-
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.
-
A non-optional argument was null