Scripting

 From:  dune1982
7238.15 In reply to 7238.11 
Thank you for your TestNetwork script, that really helped me understanding.

But now I'm at the next thing.
`var objlist = moi.geometryDatabase.createObjectList();
objlist.addObject( linea );
objlist.addObject( lineb );
objlist.addObject( linec );


var factory = moi.command.createFactory( 'network' );
factory.setInput( 0, objlist );

factory.commit();
`
What does the 0 stand for?

I tried to make this script with 9 lines ergo 3 triangles with network command one triangle at a time, this only seems to work it the objlist is created new for each triangle, so for each triangle I have to make a new var objlist = moi.geometryDatabase.createObjectList();

Does the network always take the first three objekts in the list? Is there a way to empty the list so it is not necessary to recreate it?

Last question what exactly does factory.commit(); do? As far as I understand it makes MoI Display the network on the UI. I have recognized that it takes the computer some time to do the factory.commit(); for each network again and again. Can't I let the network command create the three networks and then do the factory.commit(); at the end to only update the ui once?