GeometryInstance.Transform Property

GeometryInstanceTransform 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: 25.0.0.0 (25.0.0.0)
Syntax
public Transform Transform { get; }
Public ReadOnly Property Transform As Transform
	Get
public:
property Transform^ Transform {
	Transform^ get ();
}
member Transform : Transform with get

Property Value

Transform
Example
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);
                }
            }
        }
    }
}
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

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