Hi andrew,
> Ok great, that's good to know that commands automatically get undo support :) This one definitely
> needs it since it is quite an intrusive operation, so I'll switch it to being a command instead.
Actually I should clarify that a bit - commands automatically get undo support for all added and removed geometry. Changing just an attribute like the object name will not be covered by that current system. You could do something like clone the object, change the name on the cloned object, remove the old object from the geometry database and add in the renamed object into the geometry database in a command and then that would be undoable. The undo record will consist of the entire old object though.
> Do commands have access to any extra java script libs?
No, they have the same stuff available as inline script, but the command launcher does some various set up and tear down tasks like setting up undo records for added and removed geometry, loading the command's UI file, canceling any currently running command, clearing previous picked points, clearing any selection transition or selection lock, etc...
> Something like string.js http://stringjs.com/ would be really useful!
You can probably use it if you want, try copying the .js file to the commands folder and then in your command put #include "string.js".
- Michael
|