Scripting

 From:  Michael Gibson
7238.42 In reply to 7238.39 
Hi dune1982,

It's due to this type of sequence here:

code:
var cyl1 = factory.getCreatedObjects();
factory.commit();
cylinders.addObject(cyl1);


The variable cyl1 contains an object list, which is what factory.getCreatedObjects() returns back.

Then later on the call to cylinders.addObject() is expecting an individual object to be passed to it, but instead you are passing that object list.

There does not happen to currently be a method on object lists to combine another list with it, you'll need to make a helper function like:

function CombineLists( targetlist, fromlist )
{
for ( var i = 0; i < fromlist.length; ++i )
targetlist.addObject( fromlist.item(i) );
}

and then call that function to combine the lists together.

- Michael