Transform Property


The transform FROM the coordinate space of the box TO the model space.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 2015.0.0.0 (2015.0.0.0)

Syntax

C#
public Transform Transform { get; set; }
Visual Basic
Public Property Transform As Transform
	Get
	Set
Visual C++
public:
property Transform^ Transform {
	Transform^ get ();
	void set (Transform^ value);
}

Remarks

The transform must always be right-handed and orthonormal.

Examples

Copy C#
private void RotateBoundingBox(View3D view3d)
{
    BoundingBoxXYZ box = view3d.GetSectionBox();
    if (false == box.Enabled)
    {
        TaskDialog.Show("Revit","The section box for View3D isn't enabled.");
        return;
    }
    // Create a rotation transform,  
    XYZ origin = new XYZ(0, 0, 0);
    XYZ axis = new XYZ(0, 0, 1);
    // Rotate 2 radians
    Transform rotate = Transform.CreateRotationAtPoint(axis, 2, origin);
    // Transform the View3D's GetSectionBox() with the rotation transform
    box.Transform = box.Transform.Multiply(rotate);
    view3d.SetSectionBox(box);
}
Copy VB.NET
Private Sub RotateBoundingBox(view3d As View3D)
    Dim box As BoundingBoxXYZ = view3d.GetSectionBox()
    If False = box.Enabled Then
        TaskDialog.Show("Revit", "The section box for View3D isn't enabled.")
        Return
    End If
    ' Create a rotation transform,  
    Dim origin As New XYZ(0, 0, 0)
    Dim axis As New XYZ(0, 0, 1)
    ' Rotate 2 radians
    Dim rotate As Transform = Transform.CreateRotationAtPoint(axis, 2, origin)
    ' Transform the View3D's GetSectionBox() with the rotation transform
    box.Transform = box.Transform.Multiply(rotate)
    view3d.SetSectionBox(box)
End Sub

See Also