/*
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));
}
} |