Location.Move Method

LocationMove Method

Move the element within the project by a specified vector.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public bool Move(
	XYZ translation
)
Public Function Move ( 
	translation As XYZ
) As Boolean
public:
bool Move(
	XYZ^ translation
)
member Move : 
        translation : XYZ -> bool 

Parameters

translation  XYZ
The vector by which the element is to be moved.

Return Value

Boolean
If the element is moved successfully then the method return True, otherwise False.
Remarks
The move method is used to move an element within the project. Other elements may also be moved when this element is moved, for example: if the element is wall and it contains windows, the windows will also be moved.
Example
bool MoveUsingLocationCurve(Autodesk.Revit.ApplicationServices.Application application, Wall wall)
{
    LocationCurve wallLine = wall.Location as LocationCurve;
    XYZ translationVec = new XYZ(10, 20, 0);
    return (wallLine.Move(translationVec));
}
Private Function MoveUsingLocationCurve(application As Autodesk.Revit.ApplicationServices.Application, wall As Wall) As Boolean
    Dim wallLine As LocationCurve = TryCast(wall.Location, LocationCurve)
    Dim translationVec As New XYZ(10, 20, 0)
    Return (wallLine.Move(translationVec))
End Function

No code example is currently available or this language may not be supported.

No code example is currently available or this language may not be supported.

See Also