GetSplittingCurves Method (Document, ElementId, Plane)


Identifies the curves that were used to create the part and the plane in which they reside.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 22.0.0.0 (22.1.0.0)
Since: 2019.1

Syntax

C#
public static IList<Curve> GetSplittingCurves(
	Document document,
	ElementId partId,
	out Plane sketchPlane
)
Visual Basic
Public Shared Function GetSplittingCurves ( _
	document As Document, _
	partId As ElementId, _
	<OutAttribute> ByRef sketchPlane As Plane _
) As IList(Of Curve)
Visual C++
public:
static IList<Curve^>^ GetSplittingCurves(
	Document^ document, 
	ElementId^ partId, 
	[OutAttribute] Plane^% sketchPlane
)

Parameters

document
Type: Autodesk.Revit.DB Document
The source document of the part.
partId
Type: Autodesk.Revit.DB ElementId
The part id.
sketchPlane
Type: Autodesk.Revit.DB Plane %
The plane in which the division curves were sketched.

Return Value

The curves that created the part. Empty if partId is not a part or Part is not divided.

Examples

Copy C#
public void GetCurveDividersAndPlane(Part part)
{
   StringBuilder message = new StringBuilder();
   Plane skP = Plane.CreateByThreePoints(new XYZ(0, 0, 1), new XYZ(1, 0, 0), new XYZ(0, 1, 0));

   // Get curve dividers.
   IList<Curve> divisionCurves = PartUtils.GetSplittingCurves(part.Document, part.Id, out skP);

   if(divisionCurves.Count == 0)
      message.AppendLine("Part is not divided.");
   else
   {
      message.AppendLine("The dividers are : ");
      if(divisionCurves.Count > 0)
         message.AppendLine(divisionCurves.Count.ToString() + " division curves");
   }

   TaskDialog.Show("Revit", message.ToString());
}
Copy VB.NET
Private Sub GetCurveDividersAndPlane(ByVal part As Part)
    Dim message As StringBuilder = New StringBuilder
    Dim skP As Plane = Plane.CreateByThreePoints(New XYZ(0, 0, 1), New XYZ(1, 0, 0), New XYZ(0, 1, 0))
    ' Get curve dividers.
    Dim divisionCurves As IList(Of Curve) = PartUtils.GetSplittingCurves(part.Document, part.Id, skP)
    If (divisionCurves.Count = 0) Then
        message.AppendLine("Part is not divided.")
    Else
        message.AppendLine("The dividers are : ")
        If (divisionCurves.Count > 0) Then
            message.AppendLine((divisionCurves.Count.ToString + " division curves"))
        End If

    End If

    TaskDialog.Show("Revit", message.ToString)
End Sub

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was null

See Also