ElementTransformUtils.MirrorElements
Method
Description:
Mirrors a set of elements about a given plane.
Mirrors a set of elements about a given plane.
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.
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.
Syntax
public static IList<ElementId> MirrorElements(
Document document,
ICollection<ElementId> elementsToMirror,
Plane plane,
bool mirrorCopies
)
Parameters
Parameter | Type | Description |
---|---|---|
document | Document | The document that owns the elements. |
elementsToMirror | ICollection | 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
Type | Description |
---|---|
IList | 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). |