CurveLoop Class

A class that represents a chain of curves.
Inheritance Hierarchy
SystemObject
  Autodesk.Revit.DBCurveLoop

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

The CurveLoop type exposes the following members.

Constructors
 NameDescription
Public methodCurveLoop Constructs a new empty curve loop.
Top
Properties
 NameDescription
Public propertyIsValidObject Specifies whether the .NET object represents a valid Revit entity.
Top
Methods
 NameDescription
Public methodAppend Append the curve to this loop.
Public methodStatic memberCreate Creates a new curve loop.
Public methodStatic memberCreateViaCopy Creates a new curve loop as a copy of the input.
Public methodStatic memberCreateViaOffset(CurveLoop, IListDouble, XYZ) Creates a new curve loop that is an offset of the existing curve loop.
Public methodStatic memberCreateViaOffset(CurveLoop, Double, XYZ) Creates a new curve loop that is an offset of the existing curve loop.
Public methodStatic memberCreateViaThicken(Curve, Double, XYZ) Creates a new closed curve loop by thickening the input curve with respect to a given plane.
Public methodStatic memberCreateViaThicken(CurveLoop, Double, XYZ) Creates a new closed curve loop by thickening the input open curve loop with respect to a given plane.
Public methodStatic memberCreateViaTransform Creates a new curve loop as a transformed copy of the input curve loop.
Public methodDisposeReleases all resources used by the CurveLoop
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodFlip Reverses the orientation of the curve loop.
Protected methodGetBasicIEnumeratorReturns an enumerator that iterates through a collection.
Public methodGetCurveLoopIterator Returns a curve that iterates through the curve loop.
Public methodGetEnumeratorReturns an enumerator that iterates through a collection.
Public methodGetExactLength Returns the sum of exact lengths of all curves in the loop.
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetPlane Gets the plane of the curve loop, if it is planar.
Public methodGetRectangularHeight Returns the width of a curve loop if it is rectangular with respect to the projection plane.
Public methodGetRectangularWidth Returns the width of a curve loop if it is rectangular with respect to the projection plane.
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodHasPlane Identifies if the CurveLoop is planar.
Public methodIsCounterclockwise Determines if this CurveLoop is oriented counter-clockwise (CCW) or clockwise (CW) with respect to the specified 3D direction.
Public methodIsOpen Returns whether the curve loop is open or closed, as determined by an internal flag.
Public methodIsRectangular Identifies if the curve loop is rectangular with respect to a given projection plane.
Public methodNumberOfCurves Returns the number of curves in the curve loop.
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Public methodTransform 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