Auto loading toolbars
-
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 endanother 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 -
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 endBut 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?
-
hi kyyu,
thanks for your reply. I'll try it.it works!

-
@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 > endBut 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!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement