Script help?

 From:  Paul (AIRGLASS)
952.1 
Hi Michael:
I decided to try putting together a "nudge" script the other day using a variation of the "move" command, with the base point and target point set in the script. The idea is to select an object and use the Alt+ArrowKeys to move an object a set distance. I can't figure out tho, which properties for the movefactory that I can access to move an object (or if it's even possible).
I was thinking the base point could be an arbitrary point on the object (the midpoint maybe?) and the target point would be set by the nudge_dist variable.
Any advice on any movefactory properties I can use? (If you have time that is, I realize you're buried in the documentation work right now - )

The following is my rough outline so far :


#include "GetObjects.js"

function DoNudge()
{
var objectpicker = moi.ui.createObjectPicker();

objectpicker.allowEditPoints();

if ( GetObjects( objectpicker ) )
{
var nudge_dist = 1;
var objects = objectpicker.objects;
var movefactory = moi.command.createFactory( 'move' );

switch ( test for which arrow key? ){
case : 'LeftArrow'
nudge_dist = -1 ; break;
case : 'RightArrow'
break;
case : 'UpArrow'
nudge_dist = -1 ; break;
case : 'DownArrow'
break;
default : ;
}

movefactory.setInput( 0, objects );

switch (moi.ui.mainWindow.viewpanel.mode)
{
case 'front' :
movefactory.setInput( 1, objects.x);
movefactory.setInput( 2, objects.x + nudge_dist );
break;
case 'top' :
movefactory.setInput( 1, objects.x);
movefactory.setInput( 2, objects.x + nudge_dist );
break;
case 'right' :
movefactory.setInput( 1, objects.y);
movefactory.setInput( 2, objects.y + nudge_dist );
break;
default : ;
};

movefactory.commit();
}
}

DoNudge();


Thanks! Paul