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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement