MirrorElements Method (Document, ICollection(ElementId), Plane, Boolean)


Element Transform Utils Mirror Elements Method

Mirrors a set of elements about a given plane.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public static IList<ElementId> MirrorElements(
	Document document,
	ICollection<ElementId> elementsToMirror,
	Plane plane,
	bool mirrorCopies
)

Parameters

document Document
The document that owns the elements.
elementsToMirror ICollection ElementId
The set of elements to mirror.
plane Plane
The mirror plane.
mirrorCopies Boolean
True if mirroring should be performed on copies of the elements, leaving the original elements intact. False if no copies should be created and the elements should be mirrored directly.

Return Value

IList ElementId
A collection of ids of newly created elements - mirrored copies. It is empty if the mirrorCopies arguments is false.
Exceptions
Exception Condition
ArgumentException elementsToMirror cannot be mirrored. -or- The given element id set is empty. -or- One or more elements in elementsToMirror do not exist in the document. -or- Some of the elements cannot be copied, because they belong to different views. -or- The input set of elements contains Sketch members along with other elements or there is no active Sketch edit mode.
ArgumentNullException A non-optional argument was null
InvalidOperationException Thrown when the elements cannot be moved (e.g. due to some of the elements being pinned).
Remarks
Optionally, copies of the elements can be created prior to the operation and mirroring is then performed on the copies instead of the original elements.
See Also