Hi Hamish, to put in a code block here in the forum use <code></code> make sure you're not using something like [code] instead.
re:
> objectstojoin.addObject( FactoryAirfoil.update().getCreatedObjects() );
> objectstojoin.addObject( FactoryLine.update().getCreatedObjects() );
The problem here is factory.update() does not return anything directly itself, it just causes the geometry factory to calculate the objects and update the factory's own internal lists of objects for what was created. If you then want to get at those created objects you need to call factory.getCreatedObjects().
That's different than factory.calculate() - calling factory.calculate() does directly return an object list to the caller and generates "loose objects" which are not yet part of the geometry database main object list of objects to draw and save in the file and so forth.
So your code would need to be changed to have the .update call on a previous line before you call factory.getCreatedObjects(), something like this instead (and also be modified to deal with the ObjectList that is returned from getCreatedObjects(), you are treating it as a single object being returned rather than an object list), something like:
FactoryAirfoil.update();
var objectlist = Factory.getCreatedObjects();
for ( var i = 0; i < objectlist.length; i++ ) objectstojoin.addObject( objectlist.item(i) );
- Michael
|