CurveLoop Class


Curve Loop Class

A class that represents a chain of curves.
Inheritance Hierarchy
System Object
Autodesk.Revit.DB CurveLoop

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.3.0.0 (25.3.0.0)
Syntax
public class CurveLoop : IEnumerable<Curve>, 
	IDisposable

The CurveLoop type exposes the following members.

Constructors
Name Description
Public method CurveLoop Constructs a new empty curve loop.
Top
Properties
Name Description
Public property IsValidObject Specifies whether the .NET object represents a valid Revit entity.
Top
Methods
Name Description
Public method Append Append the curve to this loop.
Public method Static member Create
Public method Static member CreateViaCopy Creates a new curve loop as a copy of the input.
Public method Static member CreateViaOffset(CurveLoop, IList Double , XYZ)
Public method Static member CreateViaOffset(CurveLoop, Double, XYZ) Creates a new curve loop that is an offset of the existing curve loop.
Public method Static member CreateViaThicken(Curve, Double, XYZ) Creates a new closed curve loop by thickening the input curve with respect to a given plane.
Public method Static member CreateViaThicken(CurveLoop, Double, XYZ) Creates a new closed curve loop by thickening the input open curve loop with respect to a given plane.
Public method Static member CreateViaTransform Creates a new curve loop as a transformed copy of the input curve loop.
Public method Dispose Releases all resources used by the CurveLoop
Public method Equals Determines whether the specified object is equal to the current object.
(Inherited from Object )
Public method Flip Reverses the orientation of the curve loop.
Protected method GetBasicIEnumerator Returns an enumerator that iterates through a collection.
Public method GetCurveLoopIterator Returns a curve that iterates through the curve loop.
Public method GetEnumerator Returns an enumerator that iterates through a collection.
Public method GetExactLength Returns the sum of exact lengths of all curves in the loop.
Public method GetHashCode Serves as the default hash function.
(Inherited from Object )
Public method GetPlane Gets the plane of the curve loop, if it is planar.
Public method GetRectangularHeight Returns the width of a curve loop if it is rectangular with respect to the projection plane.
Public method GetRectangularWidth Returns the width of a curve loop if it is rectangular with respect to the projection plane.
Public method GetType Gets the Type of the current instance.
(Inherited from Object )
Public method HasPlane Identifies if the CurveLoop is planar.
Public method IsCounterclockwise Determines if this CurveLoop is oriented counter-clockwise (CCW) or clockwise (CW) with respect to the specified 3D direction.
Public method IsOpen Returns whether the curve loop is open or closed, as determined by an internal flag.
Public method IsRectangular Identifies if the curve loop is rectangular with respect to a given projection plane.
Public method NumberOfCurves Returns the number of curves in the curve loop.
Public method ToString Returns a string that represents the current object.
(Inherited from Object )
Public method Transform Transforms this curve loop and all of its component curves by the supplied transformation.
Top
Remarks
There are specific requirements for how valid CurveLoops must be formed:
  • The curves should typically be contiguous.
  • The CurveLoop may be either closed (where the start and end points coincide) or open.
  • There should be no self-intersections.

A CurveLoop is said to be "continuous" if either:

  • the loop contains at most one curve
  • the end of each curve coincides with the start of the next one (if there is a next curve).

Many geometry utilities require CurveLoops to be continuous, but discontinuous CurveLoops are sometimes used. For example, the curves in a continuous CurveLoop may be offset, resulting in a discontinuous loop if the offset curves overlap or do not meet, and the offset curves might then be extended or trimmed to form a continuous CurveLoop.

A CurveLoop is said to be "closed" if it is non-empty, continuous, and if either:

  • the loop contains just one curve, which is unbounded and periodic
  • the loop's end point coincides with its start point
For example, a CurveLoop comprising four lines forming a rectangle, listed in order around the rectangle, with each curve oriented in direction in which the curves are listed is closed. As another example, a CurveLoop consisting of just one unbounded circle is closed.

A CurveLoop is said to be "open" if it is not closed. For example, a CurveLoop consisting of a single line is open, as is the "offset CurveLoop" mentioned above. Note that an open CurveLoop may be continuous or discontinuous, and a continuous CurveLoop may be open or closed. The definitions imply that a discontinuous CurveLoop is necessarily open and an empty CurveLoop is open.

It should also be noted that these definitions take the order of the curves and the curves' directions into account. For example, a CurveLoop comprising the four edges of a rectangle in the order {bottom, top, left, right} is discontinuous. Similarly, a CurveLoop comprising the four edges of a rectangle in the order {bottom, right, top, left}, with three of the lines oriented in the counter-clockwise direction of the rectangle and the fourth oriented in the clockwise direction, is discontinuous.

Finally, note that some routines in Revit may set the CurveLoop to be marked "open" or "closed" in spite of the actual geometry of the curves. In these special cases, the CurveLoop class does not require that the CurveLoop is correctly marked.

In the API, the members of the CurveLoop may be directly iterated, as the class implements IEnumerable<Curve>. The iteration provides copies of the curves directly contained in the loop; modification of the curves will not affect the curves that are contained in the loop.

See Also