GetCurve Method


Returns the single curve of the Analytical Model, if it is only one curve.

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

Syntax

C#
public Curve GetCurve()
Visual Basic
Public Function GetCurve As Curve
Visual C++
public:
Curve^ GetCurve()

Return Value

Single curve of the Analytical Model.

Examples

Copy C#
public void GetColumnCurve(FamilyInstance familyInst)
{
    // get AnalyticalModel from structural column
    if (familyInst.StructuralType == StructuralType.Column)
    {
        AnalyticalModel modelColumn = familyInst.GetAnalyticalModel();
        // column should be represented by a single curve
        if (modelColumn.IsSingleCurve() == true)
        {
            Curve columnCurve = modelColumn.GetCurve();
        }
    }
}
Copy VB.NET
Public Sub GetColumnCurve(familyInst As FamilyInstance)
    ' get AnalyticalModel from structural column
    If familyInst.StructuralType = StructuralType.Column Then
        Dim modelColumn As AnalyticalModel = familyInst.GetAnalyticalModel()
        ' column should be represented by a single curve
        If modelColumn.IsSingleCurve() = True Then
            Dim columnCurve As Curve = modelColumn.GetCurve()
        End If
    End If
End Sub

Exceptions

Exception Condition
Autodesk.Revit.Exceptions InapplicableDataException This AnalyticalModel contains more than one single curve.

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 →