Nimble Nudge (Script)

 From:  Michael Gibson
11010.11 In reply to 11010.10 
Hi Cody, hmm maybe what you're describing is that when no objects are selected then calling GetObjects() will go into an event loop waiting for objects to be selected and it exits the loop when the "Done" button is pushed which is problematic since there is no UI shown for this command.

So the command will still be running until there is a cancel issued either by the Esc key being pushed or another command starting up.

What about replacing GetObjects() with a call to moi.geometryDatabase.getSelectedObjects() instead which does not do any waiting or event loop.

So where you currently have this:

code:
		var objectpicker = moi.ui.createObjectPicker();
		objectpicker.allowEditPoints();
		if ( !GetObjects( objectpicker, true ) )
		{
			return;
		}
			
		var objects = objectpicker.objects;
		if ( objects.length == 0 )
		{
			return;
		}


Instead try this:

code:
		var objects = moi.geometryDatabase.getSelectedObjects();
		if ( objects.length == 0 )
		{
			return;
		}


- Michael