SketchUp Command Calls
-
How would I put the EDIT pull down item SelectNone onto the Context menu?
Also where can I find a reference list of default SketchUp command calls for use in Ruby Script files?
-
Hi Syd,
There is a list of "send_action" commands here, but I don't see a "select none".
But, it's easy to manipulate the Selection using Ruby.
Here's short example
# select_none.rb - adds "select none" option to context menu. UI.add_context_menu_handler { |menu| menu.add_item("Select None") { Sketchup.active_model.selection.clear } }
-
To add Context Menus: http://code.google.com/intl/nb/apis/sketchup/docs/ourdoc/ui.html#add_context_menu_handler
For Sketchup commands: http://code.google.com/intl/nb/apis/sketchup/docs/ourdoc/sketchup.html#send_action
Here's the Class index of the Sketchup Ruby API: http://code.google.com/intl/nb/apis/sketchup/docs/classes.html
-
Thanks guys - I've added the code:
{ Sketchup.active_model.selection.clear }
to the existing ContextMenuMenus.rb file TIG supplied
Kind Regards
Syd
Advertisement