• Login
sketchucation logo sketchucation
  • Login
๐Ÿค‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Hide Toolbars On Load

Scheduled Pinned Locked Moved Developers' Forum
16 Posts 7 Posters 2.4k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    simonstaton
    last edited by 13 Aug 2009, 13:35

    Ok I have built a plugin that automaticly loads the components panel when sketchup loads this is the code I am using.

    status = UI.show_inspector "Components"
    

    now is there one of these that I can make that will hide the getting started toolbar on load. maybe somthing like,

    status = UI.hide_toolbar "gettingstarted"
    
    1 Reply Last reply Reply Quote 0
    • J Offline
      Jim
      last edited by 13 Aug 2009, 13:47

      The closest I've gotten to that is this:

      UI.toolbar_names.each{|n| UI.toolbar(n).hide}

      but it doesn't work.

      Hi

      1 Reply Last reply Reply Quote 0
      • S Offline
        simonstaton
        last edited by 13 Aug 2009, 14:01

        @jim said:

        The closest I've gotten to that is this:

        UI.toolbar_names.each{|n| UI.toolbar(n).hide}

        but it doesn't work.

        hmm I have posted on some ruby forums to however I dont want to hide all of the toolbars. only one if we could get the syntax for the getting started toolbar it would be much easier

        1 Reply Last reply Reply Quote 0
        • M Offline
          MartinRinehart
          last edited by 13 Aug 2009, 14:54

          This area looks like it was implemented by an engineer badly in need of sleep, no? Straightforwardly, you would have a toolbars collection and each would have a name attribute, no?

          If you don't mind losing the names, something like:

          
          toolbars = []
          UI.toolbar_names.each{ |n| toolbars.push( UI.toolbar(n) ) }
          
          

          I've done this. Turning off all toolbars (View/Toolbars menu) I ask:

          
          toolbars.each { |t| puts t.visible? }
          
          

          It prints "false" 13 times. Turn on a few toolbars, run it again and it still prints "false" 13 times.

          Has anybody sorted out what works and what doesn't here?

          Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

          1 Reply Last reply Reply Quote 0
          • S Offline
            simonstaton
            last edited by 13 Aug 2009, 15:00

            @martinrinehart said:

            Has anybody sorted out what works and what doesn't here?

            it seems like quite a few people are having this problemg

            1 Reply Last reply Reply Quote 0
            • J Offline
              Jim
              last edited by 13 Aug 2009, 15:17

              I'm happy it doesn't work. I would very much not appreciate it if your plugin messed with my toolbars.

              Hi

              1 Reply Last reply Reply Quote 0
              • S Offline
                simonstaton
                last edited by 13 Aug 2009, 15:33

                I am in touch with abe from hypercosm and he seems to of done this with his viewer so maybe he can give me some insight

                1 Reply Last reply Reply Quote 0
                • M Offline
                  MartinRinehart
                  last edited by 13 Aug 2009, 18:46

                  @jim said:

                  I'm happy it doesn't work.

                  No you're not, Jim. Plugins are easy to delete, which I'm sure you'd do if some plugin author thinks he knows better than you what toolbars you should be looking at. But there's a lot of potential for plugins whose purpose in life is to let you organize your toolbars your way.

                  Think about plugins specific to showing/hiding toolbars. I don't use toolbars (keyboard shortcuts rule!) but I'd like a tiny one that I could tailor to show stuff like an Add Scene and Update Scene at movie-making time and turn them off when the model's not ready for movies. I'd even like a button that turns the large toolbar on when I need no-shortcut stuff like Follow Me and the Protractor.

                  And I'd like a plugin that converts the View/Toolbars submenu into a toolbar.

                  Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

                  1 Reply Last reply Reply Quote 0
                  • A Offline
                    AdamB
                    last edited by 14 Aug 2009, 05:56

                    I'm with Jim on this. Sounds a like a disaster to allow plugins to impose their view on how the GUI should work.

                    And if its just for something small - why do you not simply create your own toolbar for this? Then you can flash it on and off to your hearts content ๐Ÿ˜„

                    Adam

                    Developer of LightUp Click for website

                    1 Reply Last reply Reply Quote 0
                    • S Offline
                      simonstaton
                      last edited by 14 Aug 2009, 08:32

                      @adamb said:

                      I'm with Jim on this. Sounds a like a disaster to allow plugins to impose their view on how the GUI should work.
                      why do you not simply create your own toolbar for this?

                      well tbh I am changing the look of the GUI. I am handing out a copy of sketchup to our clients and it is going to have all of our 3d models in the components panel however we dont want them to be able to edit the components which we know some of them will end up doing with things like the draw tool. so we have built our own toolbar that exports the model as a jpg and can also add it to a shopping cart.

                      1 Reply Last reply Reply Quote 0
                      • S Offline
                        simonstaton
                        last edited by 14 Aug 2009, 10:15

                        I am actually quite suprised at how hard this is turning out to be I thought it would be a simple one line code hideing a toolbar

                        1 Reply Last reply Reply Quote 0
                        • A Offline
                          AdamB
                          last edited by 14 Aug 2009, 13:33

                          You might be finding it hard because you're trying to hammer a square peg into a round hole... Like anything you've got to play how a system wants to play rather than try and beat it into submission.

                          If you want to have a bunch of components that you don't wish to be edited permanently, then you install your Components in Sketchup.find_support_file 'Components' so they appear in the Component browser but are 'copy by value' when used so any changes don't mess with the 'original'.

                          Or ship your components all wrapped as 'Locked' Groups.

                          Adam

                          Developer of LightUp Click for website

                          1 Reply Last reply Reply Quote 0
                          • J Offline
                            Jim
                            last edited by 14 Aug 2009, 13:39

                            Have you considered handing out the SketchUp Viewer instead of SketchUp?

                            Nevermind - I see you would like to be able to run Ruby code too.

                            Hi

                            1 Reply Last reply Reply Quote 0
                            • TIGT Offline
                              TIG Moderator
                              last edited by 14 Aug 2009, 14:36

                              Seems that the Toolbar options like toolbar=UI.toolbar("Drawing");toolbar.show, .hide, .restore etc just don't work: also UI.toobar_names only returns the standard toolbar names not custom-toolbar ones... a whole messy method area in need of some TLC... ๐Ÿ˜ž

                              TIG

                              1 Reply Last reply Reply Quote 0
                              • thomthomT Offline
                                thomthom
                                last edited by 1 Nov 2009, 12:19

                                @jim said:

                                The closest I've gotten to that is this:

                                UI.toolbar_names.each{|n| UI.toolbar(n).hide}

                                but it doesn't work.

                                UI.toolbar_names.each{|n| UI.set_toolbar_visible(n, false) }

                                UI.set_toolbar_visible works for the built-in Sketchup toolbars.
                                UI.toolbar works for Ruby toolbars
                                UI.toolbar Will never fail. If you use a name of a toolbar not present, Sketchup will create a new toolbar. !!!

                                UI.toolbar_visible? Works only for the toolbars returned in UI.toolbar_names
                                For Ruby toolbars you need to use UI.toolbar('Sandbox').visible?

                                I've seen in the Windows registry that Ruby toolbar names are mentioned in their setting section. Might be possible to extract a list there. Not sure how you query Mac settings...
                                This is also an option. http://forums.sketchucation.com/viewtopic.php?f=180&t=16756&p=132602#p132602

                                Thomas Thomassen โ€” SketchUp Monkey & Coding addict
                                List of my plugins and link to the CookieWare fund

                                1 Reply Last reply Reply Quote 0
                                • Dan RathbunD Offline
                                  Dan Rathbun
                                  last edited by 6 Nov 2009, 18:44

                                  @simonstaton said:

                                  ...now is there one of these [methods] that I can make that will hide the getting started toolbar on load? ...[snip]...

                                  ANSWER: Yes there is !
                                  The following code hides the "GettingStarted" toolbar at any time, whether it's docked or floating.

                                  status = UI.set_toolbar_visible("GettingStarted", false)
                                  

                                  I'm not here much anymore.

                                  1 Reply Last reply Reply Quote 0
                                  • 1 / 1
                                  • First post
                                    Last post
                                  Buy SketchPlus
                                  Buy SUbD
                                  Buy WrapR
                                  Buy eBook
                                  Buy Modelur
                                  Buy Vertex Tools
                                  Buy SketchCuisine
                                  Buy FormFonts

                                  Advertisement