ElementTransformUtils.CopyElement
Method
Description:
Copies an element and places the copy at a location indicated by a given transformation.
Copies an element and places the copy at a location indicated by a given transformation.
Syntax
public static ICollection<ElementId> CopyElement(
Document document,
ElementId elementToCopy,
XYZ translation
)
Parameters
Parameter | Type | Description |
---|---|---|
document | Document | The document that owns the element. |
elementToCopy | ElementId | The id of the element to copy. |
translation | XYZ | The translation vector for the new element. |
Return Value
Type | Description |
---|---|
ICollection | The ids of the newly created copied elements. More than one element may be created due to dependencies. |
Exceptions
Exception | Condition |
---|---|
ArgumentException | The element elementToCopy 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 |
InvalidOperationException | It is not allowed to copy Sketch member to non-parallel sketch. -or- If we are not able to copy the element. |