The script for chain

 From:  Michael Gibson
6087.23 In reply to 6087.22 
Hi Brian,

> Is it a problem with the rail? Is the rail a list or an object, with one or multiple parts?

The rail should be an object list, it can be either one rail curve for a one-rail sweep, a list of 2 curves for a 2 rail sweep, or 3 or more curves to do a one-rail sweep on each of them.

The problem is that sweep is an asynchronous factory and it requires an object ID to be set for transferring geometry over into the command processor (async factories are actually generated inside of the moi_commandprocessor.exe process instead of inside of moi.exe). Because your rail has been created through script and never added to the geometry database, it doesn't have an ID yet and so doesn't work with sweep. If you add it to the geometry database it will then work. You'll need to do that for both the circle and the rail as well. (EDIT: see added info below, only add the circle).

So something like call:

moi.geometryDatabase.addObjects( rail ); // addObjects takes an object list
moi.geometryDatabase.addObject( circle );

Before doing the sweep.


EDIT:

Actually it's not the rail that wasn't in there, it was the circle that wasn't in the geometry database. So don't try to add in the rails again or else you'll get an assert.


The rails were already in the geometry database because they were created by .update() and then .getCreatedObjects() - that sequence adds stuff to the geometry database. The circle was created just by .calculate() which just generates an object and does not add it into the geometry database automatically.

So get the circle into the geometry database before doing the sweep and it should then work for you.


I'll see if I can eliminate this requirement for async factories to have things inserted into the geometry database before they can be remoted.


- Michael