Copies an element and places the copy at a location indicated by a given transformation.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 21.0.0.0 (21.1.1.109)
Since: 2012
Syntax
C# |
---|
public static ICollection<ElementId> CopyElement( Document document, ElementId elementToCopy, XYZ translation ) |
Visual Basic |
---|
Public Shared Function CopyElement ( _ document As Document, _ elementToCopy As ElementId, _ translation As XYZ _ ) As ICollection(Of ElementId) |
Visual C++ |
---|
public: static ICollection<ElementId^>^ CopyElement( Document^ document, ElementId^ elementToCopy, XYZ^ translation ) |
Parameters
- document
- Type: Autodesk.Revit.DB..::..Document
The document that owns the element.
- elementToCopy
- Type: Autodesk.Revit.DB..::..ElementId
The id of the element to copy.
- translation
- Type: Autodesk.Revit.DB..::..XYZ
The translation vector for the new element.
Return Value
The ids of the newly created copied elements. More than one element may be created due to dependencies.
Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.Exceptions..::..ArgumentException | The element elementToCopy does 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 the element. |