Replace in place?

 From:  Michael Gibson
3974.2 In reply to 3974.1 
Hi Pilou, I'm not sure if this is exactly what you need, but Petr wrote a custom command here:
http://kyticka.webzdarma.cz/3d/moi/#CopyToPoints
which allows you to copy an object from a base point to a set of point objects.


You can also place a point object at the center of the selected object's bounding box by using the BoundingBoxCenter command:
http://moi3d.com/2.0/docs/moi_command_reference10.htm#boundingboxcenter


Maybe these in combination with one another will get you what you need - for randomness maybe that previous random selection script could be used to make a randomized selection of the points to copy to:
http://moi3d.com/forum/index.php?webtag=MOI&msg=3927.2


One problem you may run into is that when multiple objects are selected, the BoundingBoxCenter command puts just one point at the center of the combined bounding box rather than around each object individually. Here is a script that you can use to do that though - this script puts a point at the center of each individual selected object:

script: /* Place a point at each selected object's bounding center */ var objs = moi.geometryDatabase.getSelectedObjects(); for ( var i = 0; i < objs.length; ++i ) { var obj = objs.item(i); var pt = obj.getBoundingBox().center; var ptfactory = moi.command.createFactory( 'point' ); ptfactory.setInput( 0, pt ); ptfactory.commit(); }


So use this script to place the target points (randomize the selection if you want first), delete the objects, and then use Petr's command to copy a new object to those points.

- Michael