CreateCurve Method (Int32, IList(Double), IList(XYZ), IList(Double))


Creates a new geometric Curve object from NURBS curve data, which includes weights. The created curve may be a NURBSpline or a simpler curve such as line or arc.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 17.0.0.0 (17.0.484.0)
Since: 2017

Syntax

C#
public static Curve CreateCurve(
	int degree,
	IList<double> knots,
	IList<XYZ> controlPoints,
	IList<double> weights
)
Visual Basic
Public Shared Function CreateCurve ( _
	degree As Integer, _
	knots As IList(Of Double), _
	controlPoints As IList(Of XYZ), _
	weights As IList(Of Double) _
) As Curve
Visual C++
public:
static Curve^ CreateCurve(
	int degree, 
	IList<double>^ knots, 
	IList<XYZ^>^ controlPoints, 
	IList<double>^ weights
)

Parameters

degree
Type: System Int32
The degree of the NURBSpline.
knots
Type: System.Collections.Generic IList Double
The knots of the NURBSpline.
controlPoints
Type: System.Collections.Generic IList XYZ
The control points of the NURBSpline.
weights
Type: System.Collections.Generic IList Double
The weights of the NURBSpline.

Return Value

The new Curve object.

Remarks

Degree must be 1 or greater. The number of control points must be greater than degree. The number of knots must equal the sum of degree, number of controlPoints and 1. The distinct knot values (ignoring multiplicities) must be in increasing order. The first degree+1 knots should be identical, as should the last degree+1 knots. The multiplicities of other (interior) knots should be less than degree -1. The number of weights must be equal to the the number of control points. The values of all weights must be positive.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException The degree must be at least 1. -or- The number of control points must be greater than degree. -or- The number of knots must equal the sum of number of control points, degree and 1. -or- An interior knot must not repeat itself more than degree times. -or- The number of weights must be the same as the number of control points and all weights must be positive.
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was NULL
Autodesk.Revit.Exceptions ArgumentsInconsistentException Curve length is too small for Revit's tolerance (as identified by Application.ShortCurveTolerance).

See Also