NurbsCurve.Set
 
 
 

NurbsCurve.Set operator

Description

Sets the NurbsCurve geometry from a complete data description. This is only available from scripted operators, if you use it on a object with some clusters and you change the topology the burden of updating the clusters is on the user. For non-scripted operators this property can only be set if the object has been frozen.

Note: This method uses output arguments. C# and some scripting languages (such as JScript and PerlScript) don't support arguments passed by reference so you need to use the best workaround for your situation:

For scripting languages this method returns an ISIVTCollection which you can use to get the output arguments.

For C# the only available workaround is to create a VBScript custom command which returns both the output arguments and the return value in one array. For details, see What Happens when the Function Already Returns a Value?.

C# Syntax

NurbsCurve.Set( Object in_vsaControlPoints, Object in_vdKnots, Object in_vbClosed, Object in_vlDegree, Object in_veParam, siNurbsFormat in_eNurbsFormat );

Scripting Syntax

NurbsCurve.Set( ControlPoints, [Knots], [Closed], [Degree], Parameterization, [NurbsFormat] );

Parameters

Parameter Type Description
ControlPoints 2D Array The control points are stored in a 2 dimensional array. The array is a 4 * Number of U ControlPoints
Knots Array of Doubles An array of knot values.

Default Value: Knots derived from control points.

Closed Boolean Specifies whether the nurbs curve is closed .

Default Value: False

Degree Long Degree of the nurbs curves.

Default Value: 3

Parameterization siKnotParameterization The parameterization factor of the nurbs curve.

Default Value: siNonUniformParameterization

NurbsFormat siNurbsFormat Specifies how the data is formatted.

Default Value: siSINurbs

Examples

VBScript Example

Dim lDegree, bClosed, eParameterization, aControlVertex, aKnots
set oRoot = application.ActiveProject.ActiveScene.Root
set oArc = oRoot.AddGeometry( "Arc", "NurbsCurve" )
FreezeObj oArc
oArc.ActivePrimitive.Geometry.Curves(0).Get siSINurbs, aControlVertex, _
        aKnots, bClosed, lDegree, eParameterization
for i = lbound(aControlVertex,2) to ubound(aControlVertex,2)
        aControlVertex(1,i) = aControlVertex(1,i) + i
next
' Set the curve with the new vertex values.
oArc.ActivePrimitive.Geometry.Curves(0).Set aControlVertex, aKnots, bClosed, _
        lDegree, eParameterization, siSINurbs