sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    πŸ«› Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    Auto loading toolbars

    Scheduled Pinned Locked Moved Plugins
    4 Posts 2 Posters 296 Views 2 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.
    • jojo9J Offline
      jojo9
      last edited by

      Hi to all,
      i think we all love sketchup, with its great plugins. I would write rubies too, if i could, like i do for applescript.
      I see a problem in how SU loads toolbar plugins: some show up at startup, some others not. So my first thought was to add some code snippeds to this rubies, to change things.
      i tried with something like that: (but without result)

      tb = UI.toolbar("Name Toolbar") if tb.get_last_state == TB_VISIBLE UI.start_timer(0.1, false) { tb.restore } elsif tb.get_last_state == TB_NEVER_SHOWN tb.show end

      another question arises in which context (e.g handler) or place (beginning or end) i've do embed such a code, if the code does what i like to think it does.
      please help me generously, because I don't know much about ruby scripting. Thanks!

      SketchUp version: 8
      Operating system: mac 10.6

      1 Reply Last reply Reply Quote 0
      • K Offline
        kyyu
        last edited by

        Look at the plugin "Toggle Units": http://forums.sketchucation.com/viewtopic.php?t=11745
        Their version is:

        	state = tb.get_last_state
        	if(state == TB_NEVER_SHOWN)
        		tb.show 
        	elsif (state == TB_VISIBLE)
        		tb.restore
        	end
        

        But I am not really sure of the use of "restore"? The API saids "used to reposition the toolbar to its previous location". But I tried testing it (moving it and restarting SU, etc..), and don't really see what it is doing. Can anyone explain?

        1 Reply Last reply Reply Quote 0
        • jojo9J Offline
          jojo9
          last edited by

          hi kyyu,
          thanks for your reply. I'll try it.

          it works! πŸ˜„

          1 Reply Last reply Reply Quote 0
          • jojo9J Offline
            jojo9
            last edited by

            @kyyu said:

            Look at the plugin "Toggle Units": http://forums.sketchucation.com/viewtopic.php?t=11745
            Their version is:

            	state = tb.get_last_state
            > 	if(state == TB_NEVER_SHOWN)
            > 		tb.show 
            > 	elsif (state == TB_VISIBLE)
            > 		tb.restore
            > 	end
            

            But I am not really sure of the use of "restore"? The API saids "used to reposition the toolbar to its previous location". But I tried testing it (moving it and restarting SU, etc..), and don't really see what it is doing. Can anyone explain?

            Hehe,
            sorry but i'm not yet a ruby scripter. Thanks very much for the tip, it helped! πŸ˜„

            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