Keyboard shortcut icon snippet

is there a snippet to trigger keyboard shortcut ? i would like to assign icon with toolbar editor to it.
thanks Miro

I don’t think so!
This is the other way around, the user can choose to assign a shortcut to the command (which is assigned to the icon/menu).
You need to call that command.

Do you want to add toolbar and icon with Toolbar Editor, and trigger native SketchUp Tools/Commands?
If yes, some of it can be initiated by Sketchup.send_action class method.

hi @dezmo basicaly i instaled

assigned keyboard shotcuts to each “around blue”, around green, around red and i want to be able to call it with toolbar editor.
but as i am using sketchup for long time i am just dump for ruby scripting. :man_facepalming:

I see.
That specific extension using a condition to show the menu. Therefor it is not 'visible" for Toolbar editor.

However, the code of plugin is not encrypted, so I can dig into it: :innocent:

So you need to create a button and add a specific command to it:
“Around Red”:

CB_R90.rotate90(CB_R90.selected_comps_and_groups, "x") if CB_R90.selected_comps_and_groups

“Around Green”:

CB_R90.rotate90(CB_R90.selected_comps_and_groups, "y") if CB_R90.selected_comps_and_groups

“Around Blue”:

CB_R90.rotate90(CB_R90.selected_comps_and_groups, "z") if CB_R90.selected_comps_and_groups

Example for the first:

Oh hey, that’s my colleague Clark’s extension. I have not used it in a long long time - but isn’t that available in the Right Click context menu?

On Windows platform you can use the Windows Scripting Host’s SendKeys method using Ruby’s WIN32OLE class.

See my example of sending the ESC key to exit editing contexts:


1 Like

thank you , that works well.
:beers: :beers: :beers:

1 Like

hi @bmike
yes i am aware of it but like ikon that i just click on.
would be nice if the plugin had this option too.
thanks Miro