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: 24.0.0.0 (24.0.0.0)
Since: 2012
Syntax
C# |
---|
|
Visual Basic |
---|
|
Visual C++ |
---|
|
Parameters
- document
- Type: Autodesk.Revit.DBDocument
The document that owns the element.
- elementToCopy
- Type: Autodesk.Revit.DBElementId
The id of the element to copy.
- translation
- Type: Autodesk.Revit.DBXYZ
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.ExceptionsArgumentException | 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. |
Autodesk.Revit.ExceptionsArgumentNullException | A non-optional argument was null |
Autodesk.Revit.ExceptionsInvalidOperationException | It is not allowed to copy Sketch member to non-parallel sketch. -or- If we are not able to copy the element. |