Hide Toolbars On Load
-
@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
-
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?
-
@martinrinehart said:
Has anybody sorted out what works and what doesn't here?
it seems like quite a few people are having this problemg
-
I'm happy it doesn't work. I would very much not appreciate it if your plugin messed with my toolbars.
-
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
-
@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.
-
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
-
@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.
-
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
-
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
-
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.
-
Seems that the Toolbar options like
toolbar=UI.toolbar("Drawing");toolbar.show
,.hide
,.restore
etc just don't work: alsoUI.toobar_names
only returns the standard toolbar names not custom-toolbar ones... a whole messy method area in need of some TLC... -
@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 -
@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)
Advertisement