Cycling shortcuts

 From:  Michael Gibson
7838.2 In reply to 7838.1 
Hi arcman, here's a script that I think does what you're asking for - it will cycle through the line and polyline commands:

script: /* Cycle between line and polyline commands */ var lastcommand = ''; try { lastcommand = moi.command.getOption( 'lastcyclecommand' ); } catch(e){}; var nextcommand; if ( lastcommand == 'line' ) { nextcommand = 'polyline'; } else { nextcommand = 'line'; } moi.command.setOption( 'lastcyclecommand', nextcommand ); moi.command.execCommandSet( 'lines' ); moi.command.execCommand( nextcommand );


To switch it to arc and circle, edit the values of 'polyline' and 'line' to whatever particular arc or circle drawing commands you want. You can find the command names listed in the MoI help file reference section here: http://moi3d.com/3.0/docs/moi_command_reference11.htm#shortcutkeys

Then there is one other part to it which is the call to moi.command.execCommandSet() - it's possible to leave that out but without it the button in the side pane UI won't highlight. You can find the different command sets in the /commands sub-folder, they are .xml files in there. You would need to find which command set the command that is going to be launched is inside of and then call moi.command.execCommandSet() right before the call to moi.command.execCommand().

- Michael