Moves a set of elements 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 void MoveElements( Document document, ICollection<ElementId> elementsToMove, XYZ translation ) |
Visual Basic |
---|
Public Shared Sub MoveElements ( _ document As Document, _ elementsToMove As ICollection(Of ElementId), _ translation As XYZ _ ) |
Visual C++ |
---|
public: static void MoveElements( Document^ document, ICollection<ElementId^>^ elementsToMove, XYZ^ translation ) |
Parameters
- document
- Type: Autodesk.Revit.DB..::..Document
The document that owns the elements.
- elementsToMove
- Type: System.Collections.Generic..::..ICollection<(Of <(<'ElementId>)>)>
The set of elements to move.
- translation
- Type: Autodesk.Revit.DB..::..XYZ
The translation vector for the elements.
Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.Exceptions..::..ArgumentException | The given element id set is empty. -or- One or more elements in elementsToMove 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 move all the elements (for example, if one or more elements is pinned). -or- Move operation failed. |