NurbsSurface.Get2
 
 
 

NurbsSurface.Get2 operator

Description

Returns a complete data description of a NurbsSurface. The data is returned in a 1-dimensional array and is ordered the same as for the NurbsSurface.Get method output arguments.

Note: This method must be used with scripting languages that don't support arguments passed by reference such as JScript and PerlScript. For more information on getting output arguments, see About Output Argument Arrays.

C# Syntax

Object NurbsSurface.Get2( siNurbsFormat in_eNurbsFormat );

Scripting Syntax

oArray = NurbsSurface.Get2( [NurbsFormat] );

Return Value

Array ordered as UVControlPoints, UKnots, VKnots, UClosed, VClosed, UDegree, VDegree, UParameterization, VParameterization.

Parameters

Parameter Type Description
NurbsFormat siNurbsFormat Specifies how the data is formatted.

Default Value: siSINurbs

Examples

JScript Example

/*
        JScript example : shows how to retrieve the control points returned by 
        NurbsSurface.Get2
*/
var oRoot = Application.ActiveProject.ActiveScene.Root;
var oSphere = oRoot.AddGeometry( "Sphere", "NurbsSurface" );
// convert VB array to JScript array
var vbArgs = new VBArray(oSphere.ActivePrimitive.Geometry.Surfaces(0).Get2( siSINurbs ));
// get the control points 
var vbArg0 = vbArgs.getItem(0);
var nElem1 = vbArg0.ubound(1)-vbArg0.lbound(1)+1;
var nElem2 = vbArg0.ubound(2)-vbArg0.lbound(2)+1;
var nElem3 = vbArg0.ubound(3)-vbArg0.lbound(3)+1;
for (j = 0; j < nElem3; j++) 
{
        for (i = 0; i < nElem2; i++) 
        {
                LogMessage("cpoints[0]" + "[" + i + "]" + "[" + j + "]: " + vbArg0.getItem(0,i,j));
                LogMessage("cpoints[1]" + "[" + i + "]" + "[" + j + "]: " + vbArg0.getItem(1,i,j));
                LogMessage("cpoints[2]" + "[" + i + "]" + "[" + j + "]: " + vbArg0.getItem(2,i,j));
                LogMessage("cpoints[3]" + "[" + i + "]" + "[" + j + "]: " + vbArg0.getItem(3,i,j));             
        }
}

See Also

NurbsSurface.Get