Open my Toolbar when launch Sketchup?

Hello everyone. Is there a way to always open my Toolbar when i launch sketchup even if i hide the toolbar before close de Sketchup ?

Try Class: UI::Toolbar — SketchUp Ruby API Documentation
or Class: UI::Toolbar — SketchUp Ruby API Documentation
And also to see if it’s visible consider Class: UI::Toolbar — SketchUp Ruby API Documentation

1 Like

Already try that, but it is hidden so the toolbar.restore doesn’t work. Also toolbar.show is not working when the toolbar is closed
I’m new on Ruby Sketchup so maybe i am doing something wrong


what is your current toolbar code?

john

Please don’t do this. If the user has closed the toolbar it should remain closed until the user chooses to show it. There are all kinds of reasons for hiding a toolbar, ranging from only using the extension every now and then and having it hidden the rest of the time to using it all of the time and instead relying on shortcuts.

3 Likes

def ferramentas_gratuitas

toolbar = UI::Toolbar.new “Freire Project 3D”

cmd = UI::Command.new(“Bem Vindo!”) { tela_de_login }
cmd.small_icon = File.join(File.dirname(FILE), “imagens”, “logo_freireproject.png”)
cmd.large_icon = File.join(File.dirname(FILE), “imagens”, “logo_freireproject.png”)
toolbar.add_item cmd

toolbar.add_separator # LINHA DE SEPARAÇÃO

cmd = UI::Command.new(“Rotacionar Objeto X 90Âș”) { rot_90(“vermelho”) }
cmd.small_icon = File.join(File.dirname(FILE), “imagens”, “icone_image_rotacao_X.png”)
cmd.large_icon = File.join(File.dirname(FILE), “imagens”, “icone_image_rotacao_X.png”)
cmd.tooltip = “Rotação 90Âș - X”
cmd.status_bar_text = “Gira o objeto em 90Âș de X”
toolbar.add_item cmd

cmd = UI::Command.new(“Rotacionar Objeto Y 90Âș”) { rot_90(“verde”) }
cmd.small_icon = File.join(File.dirname(FILE), “imagens”, “icone_image_rotacao_Y.png”)
cmd.large_icon = File.join(File.dirname(FILE), “imagens”, “icone_image_rotacao_Y.png”)
cmd.tooltip = “Rotação 90Âș - Y”
cmd.status_bar_text = “Gira o objeto em 90Âș de Y”
toolbar.add_item cmd

toolbar.show

end

OBS: Some descriptions are in Portuguese.

Please format your code properly.
As it is it’s unreadable.
Use the image tag

1 Like