GetCurveElementIds Method


Retrieves the set of ElementIds of curves forming the boundary of the Path Reinforcement.

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

Syntax

C#
public IList<ElementId> GetCurveElementIds()
Visual Basic
Public Function GetCurveElementIds As IList(Of ElementId)
Visual C++
public:
IList<ElementId^>^ GetCurveElementIds()

Return Value

A collection of ElementIds of ModelCurve elements.

Remarks

Each ElementId in the collection is an Id of an Element of type ModelCurve.

Examples

Copy C#
private void Getinfo_PathReinforcementCurve(PathReinforcement pathReinforcement)
{
    string message = "Path Reinforcement Curves : ";

    // Get path reinforcement curves by iterating the Curves property
    IList<ElementId> curveIds = pathReinforcement.GetCurveElementIds();
    foreach (Autodesk.Revit.DB.ElementId ii in curveIds)
    {
        ModelCurve pathReinforcementCurve = doc.GetElement(ii) as ModelCurve;
        if (null == pathReinforcementCurve)
        {
            continue;
        }

        Autodesk.Revit.DB.Curve curve = pathReinforcementCurve.GeometryCurve;

        // Get curve start point
        message += "\nCurve start point:(" + curve.GetEndPoint(0).X + ", "
            + curve.GetEndPoint(0).Y + ", " + curve.GetEndPoint(0).Z + ")";
        // Get curve end point
        message += "; Curve end point:(" + curve.GetEndPoint(1).X + ", "
            + curve.GetEndPoint(1).Y + ", " + curve.GetEndPoint(1).Z + ")";


    }
    TaskDialog.Show("Revit", message);

}
Copy VB.NET
Private Sub Getinfo_PathReinforcementCurve(pathReinforcement As PathReinforcement)
    Dim message As String = "Path Reinforcement Curves : "

    ' Get path reinforcement curves by iterating the Curves property
    Dim curveIds As IList(Of ElementId) = pathReinforcement.GetCurveElementIds()
    For Each ii As Autodesk.Revit.DB.ElementId In curveIds
        Dim pathReinforcementCurve As ModelCurve = TryCast(doc.GetElement(ii), ModelCurve)
        If pathReinforcementCurve Is Nothing Then
            Continue For
        End If

        Dim curve As Autodesk.Revit.DB.Curve = pathReinforcementCurve.GeometryCurve

        ' Get curve start point
        message += ((vbLf & "Curve start point:(" + curve.GetEndPoint(0).X & ", ") + curve.GetEndPoint(0).Y & ", ") + curve.GetEndPoint(0).Z & ")"
        ' Get curve end point



        message += (("; Curve end point:(" + curve.GetEndPoint(1).X & ", ") + curve.GetEndPoint(1).Y & ", ") + curve.GetEndPoint(1).Z & ")"
    Next
    TaskDialog.Show("Revit", message)

End Sub

See Also