Hi Peer, try this:
code:
var index = 0;
var destinationPoint = moi.vectorMath.createPoint(1,1,1);
var rect_factory = moi.command.createFactory( 'rectangle' );
rect_factory.setInput( 0, moi.vectorMath.createFrame() );
rect_factory.setInput( 1, null );
rect_factory.setInput( 2, 5 );
rect_factory.setInput( 3, 5 );
rect_factory.setInput( 4, false );
var objList = rect_factory.calculate();
//moi.geometryDatabase.addObjects(objList);
var obj = objList.item(0);
obj.showPoints = true; // must show points to make them editable
obj.setEditPointSelected(index, true);
/*
non-interactive object picker with allowEditPoints()
simply to get edit point into an objectList so that it can be manipulated
*/
/*
var objectpicker = moi.ui.createObjectPicker();
objectpicker.allowEditPoints();
objectpicker.done();
var editPointInList = objectpicker.objects;
*/
var basePt = obj.getEditPoint(index);
var factory = moi.command.createFactory('move');
factory.setInput(0, objList);
factory.setInput(1, basePt)
factory.setInput(2, destinationPoint);
// remove the original object, gather up the newly moved object, and add to database
moi.geometryDatabase.removeObject(obj);
var movedObjInList = factory.calculate();
moi.geometryDatabase.addObjects(movedObjInList);
// re-hide the edit points
movedObjInList.item(0).showPoints = false;
That removes moi.geometryDatabase.addObjects(objList); , and removes the objectpicker piece
|