Revit 2025 API
Element |
Copies an element and places the copy at a location indicated by a given transformation.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public static ICollection<ElementId> CopyElement( Document document, ElementId elementToCopy, XYZ translation )
Public Shared Function CopyElement ( document As Document, elementToCopy As ElementId, translation As XYZ ) As ICollection(Of ElementId)
public: static ICollection<ElementId^>^ CopyElement( Document^ document, ElementId^ elementToCopy, XYZ^ translation )
static member CopyElement : document : Document * elementToCopy : ElementId * translation : XYZ -> ICollection<ElementId>
Parameters
- 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
ICollectionElementIdThe ids of the newly created copied elements. More than one element may be created due to dependencies.

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. |
See Also