/*
This example demonstrates how to retrieve the output arguments
returned by NurbsCurve.Get2
*/
var oRoot = Application.ActiveProject.ActiveScene.Root;
var oArc = oRoot.AddGeometry( "Arc", "NurbsCurve" );
// convert VB array to JScript array
var vbArgs = new VBArray(oArc.ActivePrimitive.Geometry.Curves(0).Get2( siSINurbs ))
var args = vbArgs.toArray();
// get the control points
var vbArg0 = new VBArray(args[0]);
var cpoints = vbArg0.toArray();
LogMessage("control points: " + cpoints.length );
for (i = 0; i < cpoints.length; i++)
{
LogMessage("cpoints " + i + ": " + cpoints[i] );
}
// get the knots
var vbArg1 = new VBArray(args[1]);
var knots = vbArg1.toArray();
LogMessage("knots: " + knots.length );
for (i = 0; i < knots.length; i++)
{
LogMessage("knots " + i + ": " + knots[i] );
}
// get nurbs closeness state
LogMessage("closed: " + args[2] );
// get nurbs degree
LogMessage("degree: " + args[3] );
// get nurbs parameterization factor
LogMessage("parameterization: " + args[4] ); |