Scripting

 From:  Michael Gibson
7238.44 In reply to 7238.43 
Hi dune1982

> Ok I will try it with the fuction. But isn't there a return blabla missing in the function?

Functions don't always have to return a value if they are written to just operate on the parameters that are passed to them which is what that little function is set up for.


> But isn't there a way to add an object to a list. In this case if var cyl1 = factory.getCreatedObjects();
> creates the objectlist cyl1 so I could just add the next cylinder to the list cyl1

Yes that would work too.


> In my mind i would do cyl1.addObject(factory.getCreatedObjects()); in the factory for the next
> cylinder, but then I would add a list to a list which is not possible.

Unfortunately the way you want to do it here won't work because the addObject() method only expects to receive an individual object, and you are instead passing it an object list here. In the future I would like to improve this to make things more flexible, like maybe having an .add() method that could take either an individual object or an object list, but that's not how it is set up at the moment though.

- Michael