AutoRotate script final

 From:  Michael Gibson
1001.2 In reply to 1001.1 
Very cool that you're able to leverage different UI controls now!

I hope you are having fun tinkering with this, it can be fun thinking of how you want something to work and making it do exactly what you want.

Hopefully when I get some more time to work on it I can make it possible to hook up a debugger to the script, right now when you are developing a script it can be hard to debug it.

Let's see a couple of comments - in this case I think you can leave off the display:none on the parts of the UI, and just skip the beginUIUpdate() / showUI() / endUIUpdate() stuff. That stuff is meant for commands that have different stages in the command and show different prompts and different UI controls at each stage. That beginUIUpdate() / endUIUpdate() thing is there to batch up a bunch of shows and hides into one atomic operation to avoid flickering. Because the command script runs on its own thread independent of the main program it is possible for there to be stuff like redraws between each line of script being run.

The only other thing other than that, is I think that the speed of rotation for this may be machine dependent, on a fast machine where the script is able to loop faster and the redraw is faster, it may whiz around pretty rapidly... One thing that might alleviate that would be to run the actual rotate in the .htm <script> instead of the actual command .js file - maybe something like a Start() and Stop() function in the .htm file, and have Start() call the HTML window.setInterval() to call a Rotate() function at periodic timed intervals, with Stop() calling window.clearInterval(). Being based off of a timer interval would make for more consistent speed on different machines. But you already have the slider to change the speed so that may not be necessary.

- Michael