sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    If Toolbar is true make it false

    Scheduled Pinned Locked Moved Developers' Forum
    54 Posts 4 Posters 2.6k Views 4 Watching
    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 simonstaton

      Hi,

      I have managed to capture the event to hide and open the Getting Started toolbar:

      Sketchup.send_action(21992)

      Now I have this is there anyway to make it so that if the toolbar is open make it closed and if its closed leave it closed meaning that each time I start up sketchup or when its started for the first time it will hide the Getting Started.

      maybe somthing like this (obviously not this but the basics 😲)

      21992 = true {Sketchup.send_action(21992)}

      Thanks Guys,
      Simon

      1 Reply Last reply Reply Quote 0
      • S Offline
        simonstaton
        last edited by

        I just found the following in the Google SketchUp Ruby API

        status = UI.set_toolbar_visible("Camera", true)

        could I maybe change this to make what I want work?

        1 Reply Last reply Reply Quote 0
        • thomthomT Offline
          thomthom
          last edited by

          UI.toolbar_names
          http://code.google.com/apis/sketchup/docs/ourdoc/ui.html#toolbar_names

          @unknownuser said:

          The toolbar_names method is used to returns the name of all the available toolbars (this differs between PC and Mac).

          > UI.toolbar_names ["Standard", "Principle", "Camera", "Drawing", "Edit", "Construction", "Walk", "DisplayMode", "StandardViews", "Section", "Google", "GettingStarted", "VCB"]

          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

            @thomthom said:

            @unknownuser said:

            The toolbar_names method is used to returns the name of all the available toolbars (this differs between PC and Mac).

            > UI.toolbar_names ["Standard", "Principle", "Camera", "Drawing", "Edit", "Construction", "Walk", "DisplayMode", "StandardViews", "Section", "Google", "GettingStarted", "VCB"]

            The PC world still wonders, what the differences are on the MAC.

            I'm not here much anymore.

            1 Reply Last reply Reply Quote 0
            • S Offline
              simonstaton
              last edited by

              status = UI.set_toolbar_visible("GettingStarted", true) didnt seem to work :s

              is there anyway to detect so maybe code like: "GettingStarted" = true { Sketchup.send_action(21992)}

              Apologies for my coding attempts I am used to javascript and not ruby πŸ˜„

              1 Reply Last reply Reply Quote 0
              • Dan RathbunD Offline
                Dan Rathbun
                last edited by

                @simonstaton said:

                I just found the following in the Google SketchUp Ruby API
                status = UI.set_toolbar_visible("Camera", true)
                could I maybe change this to make what I want work?

                You asked this same question back in August.
                http://forums.sketchucation.com/viewtopic.php?f=180&t=21156
                I Answered it (in the last post of that topic):
                ANSWER: Hide Toolbars On Load

                I'm not here much anymore.

                1 Reply Last reply Reply Quote 0
                • S Offline
                  simonstaton
                  last edited by

                  that dosnt seem to work :s

                  1 Reply Last reply Reply Quote 0
                  • Dan RathbunD Offline
                    Dan Rathbun
                    last edited by

                    @simonstaton said:

                    Sketchup.send_action(21992)

                    By the way.. the numeric arguments to .send_action are ONLY PC, you need to use the string args to be cross-platform (if that matters.)

                    I'm not here much anymore.

                    1 Reply Last reply Reply Quote 0
                    • Dan RathbunD Offline
                      Dan Rathbun
                      last edited by

                      @simonstaton said:

                      that dosnt seem to work :s

                      Close Sketchup, restart, open the 'GettingStarted' toolbar from the View > Toolbars menu. Then open the Ruby Console and try it again (paste it into the command box just as I had posted.)

                      Then tell us the result. (You may have corrupted something.)

                      I'm not here much anymore.

                      1 Reply Last reply Reply Quote 0
                      • S Offline
                        simonstaton
                        last edited by

                        that should be fine as its only going to be run on pcs, damn macs πŸ’š

                        as the 'status = UI.set_toolbar_visible("GettingStarted", false)' dosnt work and the send action can open and close the toolbar, is there no way to pickup if GettingStarted is showing and if it is have it send action to toggle it off?

                        Simon

                        1 Reply Last reply Reply Quote 0
                        • S Offline
                          simonstaton
                          last edited by

                          @dan rathbun said:

                          @simonstaton said:

                          that dosnt seem to work :s

                          Close Sketchup, restart, open the 'GettingStarted' toolbar from the View > Toolbars menu. Then open the Ruby Console and try it again (paste it into the command box just as I had posted.)

                          Then tell us the result. (You may have corrupted something.)

                          no still nothing πŸ˜• how about my above method?

                          1 Reply Last reply Reply Quote 0
                          • Dan RathbunD Offline
                            Dan Rathbun
                            last edited by

                            @simonstaton said:

                            no still nothing

                            Check any code that is loading from the plugins folder, you must be corrupting something, because it DOES work.

                            You can try resetting the Sketchup UI to factory defaults.
                            Window menu > Preferences item
                            Preferences dialog > Workspace page > Reset Workspace button

                            I'm not here much anymore.

                            1 Reply Last reply Reply Quote 0
                            • thomthomT Offline
                              thomthom
                              last edited by

                              UI.set_toolbar_visible('GettingStarted', true) unless UI.toolbar_visible?('GettingStarted')

                              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

                                @simonstaton said:

                                how about my above method?

                                yes sure

                                
                                status = if UI.toolbar_visible?('GettingStarted')
                                  Sketchup.send_action(21992)
                                end
                                
                                

                                which is the eqiuvalent of:
                                status = UI.set_toolbar_visible("GettingStarted", false)

                                I'm not here much anymore.

                                1 Reply Last reply Reply Quote 0
                                • thomthomT Offline
                                  thomthom
                                  last edited by

                                  Oh - you tried that and it didn't work. Odd. See if Dan suggestion of resetting the workspace works. Becaus eI tested that snippet and it works.

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

                                  1 Reply Last reply Reply Quote 0
                                  • S Offline
                                    simonstaton
                                    last edited by

                                    no still nothing changes when I use that code either in the ruby console or in the .rb files and after doing what you said I am however using sketchup 6 if that could stop this from working?

                                    1 Reply Last reply Reply Quote 0
                                    • S Offline
                                      simonstaton
                                      last edited by

                                      I just tested this out in sketchup 7 and it does work fine so it must just be sketchup 6

                                      1 Reply Last reply Reply Quote 0
                                      • Dan RathbunD Offline
                                        Dan Rathbun
                                        last edited by

                                        @simonstaton said:

                                        I am however using sketchup 6 if that could stop this from working?

                                        Don't know never used v6

                                        Why can't you upgrade to v7.1MR2 ?

                                        I'm not here much anymore.

                                        1 Reply Last reply Reply Quote 0
                                        • S Offline
                                          simonstaton
                                          last edited by

                                          some of the features I am using on my toolbar dont want to work in sketchup 7 😠 such as my checkout system,

                                          is it ok if I try detecting the toolbar being open? any chance you know any code that I could use to see if it is visible then using an if statement have it send the action.

                                          1 Reply Last reply Reply Quote 0
                                          • thomthomT Offline
                                            thomthom
                                            last edited by

                                            @simonstaton said:

                                            some of the features I am using on my toolbar dont want to work in sketchup 7 😠 such as my checkout system,

                                            What doesn't work and why?

                                            @simonstaton said:

                                            is it ok if I try detecting the toolbar being open? any chance you know any code that I could use to see if it is visible then using an if statement have it send the action.

                                            I mentioned that here: http://forums.sketchucation.com/viewtopic.php?f=180&t=29216&start=0#p254562
                                            UI.toolbar_visible?('GettingStarted')

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

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

                                            Advertisement