MoveSubElement Method


Form Move Sub Element Method

Move a face/edge/curve/vertex of the form, specified by a reference, and an offset vector.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 27.0.4.0 (27.0.4.0)
Syntax
public void MoveSubElement(
	Reference subElementReference,
	XYZ offset
)

Parameters

subElementReference Reference
The geometry reference of face/edge/curve/vertex
offset XYZ
The vector by which the element is to be moved.
Example
C#
public void MoveSubElement(Form form)
{
    if (form.ProfileCount > 0)
    {
        int profileIndex = 0;   // get first profile
        ReferenceArray ra = form.get_CurveLoopReferencesOnProfile(profileIndex, 0);
        foreach (Reference r in ra)
        {
            ReferenceArray ra2 = form.GetControlPoints(r);
            foreach (Reference r2 in ra2)
            {
                Point vertex = document.GetElement(r2).GetGeometryObjectFromReference(r2) as Point;

                XYZ offset = new XYZ(0, 15, 0);
                form.MoveSubElement(r2, offset);
                break;  // just move the first point
            }
        }
    }
}
See Also
ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →