CopyElements Method (Document, ICollection(ElementId), XYZ)

Copies a set of elements and places the copies at a location indicated by a given translation.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: (
Since: 2012


public static ICollection<ElementId> CopyElements(
	Document document,
	ICollection<ElementId> elementsToCopy,
	XYZ translation
Visual Basic
Public Shared Function CopyElements ( _
	document As Document, _
	elementsToCopy As ICollection(Of ElementId), _
	translation As XYZ _
) As ICollection(Of ElementId)
Visual C++
static ICollection<ElementId^>^ CopyElements(
	Document^ document, 
	ICollection<ElementId^>^ elementsToCopy, 
	XYZ^ translation


Type: Autodesk.Revit.DB Document
The document that owns the elements.
Type: System.Collections.Generic ICollection ElementId
The set of elements to copy.
Type: Autodesk.Revit.DB XYZ
The translation vector for the new elements.

Return Value

The ids of the newly created copied elements.


This method is not suitable for elements that are hosted in other elements as it does not perform rehosting. If you need to rehost your elements in addition to copying them, use one of the other CopyElements() overloads.


Exception Condition
Autodesk.Revit.Exceptions ArgumentException The given element id set is empty. -or- One or more elements in elementsToCopy do not exist in the document.
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was null
Autodesk.Revit.Exceptions InvalidOperationException If we are not able to copy all the elements.

See Also