Transform Property


The affine transformation from the local coordinate space of the symbol into the coordinate space of the instance.

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

Syntax

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

Examples

Copy C#
public void GetAndTransformCurve(Autodesk.Revit.ApplicationServices.Application app, 
    Autodesk.Revit.DB.Element element, Options geoOptions)
{
    // Get geometry element of the selected element
    Autodesk.Revit.DB.GeometryElement geoElement = element.get_Geometry(geoOptions);

    // Get geometry object
    foreach (GeometryObject geoObject in geoElement)
    {
        // Get the geometry instance which contains the geometry information
       Autodesk.Revit.DB.GeometryInstance instance = 
           geoObject as Autodesk.Revit.DB.GeometryInstance;
        if (null != instance)
        {
            foreach (GeometryObject o in instance.SymbolGeometry)
            {
                // Get curve
                Curve curve = o as Curve;
                if (curve != null)
                {
                    // transfrom the curve to make it in the instance's coordinate space
                    curve = curve.CreateTransformed(instance.Transform);
                }
            }
        }
    }
}
Copy VB.NET
Public Sub GetAndTransformCurve(app As Autodesk.Revit.ApplicationServices.Application, element As Autodesk.Revit.DB.Element, geoOptions As Options)
    ' Get geometry element of the selected element
    Dim geoElement As Autodesk.Revit.DB.GeometryElement = element.Geometry(geoOptions)

    ' Get geometry object
    For Each geoObject As GeometryObject In geoElement
        ' Get the geometry instance which contains the geometry information
        Dim instance As Autodesk.Revit.DB.GeometryInstance = TryCast(geoObject, Autodesk.Revit.DB.GeometryInstance)
        If instance IsNot Nothing Then
            For Each o As GeometryObject In instance.SymbolGeometry
                ' Get curve
                Dim curve As Curve = TryCast(o, Curve)
                If curve IsNot Nothing Then
                    ' transfrom the curve to make it in the instance's coordinate space
                    curve = curve.CreateTransformed(instance.Transform)
                End If
            Next
        End If
    Next
End Sub

See Also

ArchiLabs

Stop fighting Revit automation.

Build repeatable BIM design and documentation workflows with scripts, data, and AI in one place, without wrestling brittle one-off automations.

Try ArchiLabs →