2021 Class
Changes 0
C

CurveLoop

Description:
A class that represents a chain of curves.
Remarks:
There are a specific set of requirements for how valid CurveLoops must be formed:
  • The curves must typically be continuous.
  • It 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.

Inheritance Hierarchy:
System.Object
  Autodesk.Revit.DB.CurveLoop
public class CurveLoop : IEnumerable<Curve>, 
	IDisposable
Name Return Type Description
C CurveLoop() None Constructs a new empty curve loop.
Name Return Type Description
M Append(Curve) None Append the curve to this loop.
M Create(IList<Curve>) The curve loop. Creates a new curve loop.
M CreateViaCopy(CurveLoop) CurveLoop Creates a new curve loop as a copy of the input.
M CreateViaOffset(CurveLoop, Double, XYZ) CurveLoop Creates a new curve loop that is an offset of the existing curve loop.
M CreateViaOffset(CurveLoop, IList<Double>, XYZ) CurveLoop Creates a new curve loop that is an offset of the existing curve loop.
M CreateViaThicken(Curve, Double, XYZ) CurveLoop Creates a new closed curve loop by thickening the input curve with respect to a given plane.
M CreateViaThicken(CurveLoop, Double, XYZ) CurveLoop Creates a new closed curve loop by thickening the input open curve loop with respect to a given plane.
M CreateViaTransform(CurveLoop, Transform) CurveLoop Creates a new curve loop as a transformed copy of the input curve loop.
M Dispose() None Releases all resources used by the
M Flip() None Reverses the orientation of the curve loop.
M GetBasicIEnumerator() IEnumerator Returns an enumerator that iterates through a collection.
M GetCurveLoopIterator() CurveLoopIterator Returns a curve that iterates through the curve loop.
M GetEnumerator() IEnumerator<Curve> Returns an enumerator that iterates through a collection.
M GetExactLength() double Returns the sum of exact lengths of all curves in the loop.
M GetPlane() Plane Gets the plane of the curve loop, if it is planar.
M GetRectangularHeight(Plane) The height. Returns the width of a curve loop if it is rectangular with respect to the projection plane.
M GetRectangularWidth(Plane) The width. Returns the width of a curve loop if it is rectangular with respect to the projection plane.
M HasPlane() bool Identifies if the CurveLoop is planar.
M IsCounterclockwise(XYZ) bool Determines if this CurveLoop is oriented counter-clockwise (CCW) or clockwise (CW) with respect to the specified 3D direction.
M IsOpen() bool Returns whether the curve loop is open or closed, as determined by an internal flag.
M IsRectangular(Plane) bool Identifies if the curve loop is rectangular with respect to a given projection plane.
M NumberOfCurves() int Returns the number of curves in the curve loop.
M Transform(Transform) None Transforms this curve loop and all of its component curves by the supplied transformation.
Name Return Type Description
P IsValidObject bool Specifies whether the .NET object represents a valid Revit entity.