Create Method (IList(XYZ), IList(Double), IList(Double), Int32, Boolean, Boolean)


Creates a new geometric NURBSpline object.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 2015.0.0.0 (2015.0.0.0)
Since: 2014

Syntax

C#
public static NurbSpline Create(
	IList<XYZ> controlPoints,
	IList<double> weights,
	IList<double> knots,
	int degree,
	bool closed,
	bool rational
)
Visual Basic
Public Shared Function Create ( _
	controlPoints As IList(Of XYZ), _
	weights As IList(Of Double), _
	knots As IList(Of Double), _
	degree As Integer, _
	closed As Boolean, _
	rational As Boolean _
) As NurbSpline
Visual C++
public:
static NurbSpline^ Create(
	IList<XYZ^>^ controlPoints, 
	IList<double>^ weights, 
	IList<double>^ knots, 
	int degree, 
	bool closed, 
	bool rational
)

Parameters

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.
knots
Type: System.Collections.Generic IList Double
The knots of the NURBSpline.
degree
Type: System Int32
The degree of the NURBSpline.
closed
Type: System Boolean
True if the NURBSpline should be closed, false otherwise.
rational
Type: System Boolean
True if the NURBSpline is rational, false if it is irrational.

Return Value

The new NURBSpline object.

Remarks

Degree must be 3 or greater. If rational, the control points and weights array must be the same size. There must be at least degree+1 control points. The size of knots must equal the sum of degree, the size of the controlPoints array and 1. The first degree+1 knots should be identical, as should the last degree+1 knots. The knots in the middle of the sequence must be non-decreasing.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException Degree must be >= 3.
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was NULL
Autodesk.Revit.Exceptions ArgumentsInconsistentException For a rational NurbSpline, the weights array must be the same size as the control points array. -or- The control points array must contain at least degree + 1 points, and if closed, the first and last points in the control points array must be identical. -or- The size of knots must equal the sum of degree, the size of the controlPoints array and 1. The first degree+1 knots should be identical, as should the last degree+1 knots. The knots in the middle of the sequence must be non-decreasing. -or- Curve length is too small for Revit's tolerance (as identified by Application.ShortCurveTolerance).

See Also

ArchiLabs

Stop fighting Revit automation.

Build repeatable BIM design and documentation workflows with scripts, data, and AI in one place, without wrestling brittle one-off automations.

Try ArchiLabs →