Need help with arraycurve factory

 From:  Karsten (KMRQUS)
7784.1 
Hello,

I have a problem to get an arraycurve factory run in a script in 'ArrayCurveDistance' mode. The following code generates always points on the end of the curve. Is there an example script? The standard command script doesn't help me. The code should generate Points with individual distance depending on an array (NVA)


var NVA = NormalilzeVA(this.properties.DivNumProfile, 1);
var curvePts = moi.geometryDatabase.createObjectList();
var curvePt = moi.geometryDatabase.createObjectList();
var distlength;
for(i=0; i < NVA.length; i++)
{
distlength=NVA[i]*crvlength(profile);
var curvePtFac = moi.command.createFactory('arraycurve');
curvePtFac.setInput(0, curveStartPt); // geomobject to array on the curve
curvePtFac.setInput(1, profile.item(0)); // the profilecurve
curvePtFac.setInput(2,'ArrayCurveDistance'); // array mode Distance
curvePtFac.setInput(3, 2); // number of generated element (here startpoint of the curve and a second one at a distance on the curve
curvePtFac.setInput( 4, distlength); //distance between the startpoint and the calculated point on the curve
curvePt = curvePtFac.calculate();
curvePts.addObject(curvePt.item(0));
curvePtFac.cancel();
for (i = 0; i < curvePts.length; i++)
outObj.addObject(curvePts.item(i));
this.setOutputData(0, outObj);
}

Thanks in Advance!

Kind regards
Karsten