If Toolbar is true make it false
-
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
-
@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?
-
@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 -
UI.set_toolbar_visible('GettingStarted', true) unless UI.toolbar_visible?('GettingStarted')
-
@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)
-
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.
-
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?
-
I just tested this out in sketchup 7 and it does work fine so it must just be sketchup 6
-
@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 ?
-
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.
-
@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')
-
hmm that method didnt work either it must be somthing to do with my .rb code. any chance either of you could quick put the following in a .rb file in your plugins and see if closes the toolbar when sketchup loads:
status = if UI.toolbar_visible?('GettingStarted')
Sketchup.send_action(21992)
endif it does then it must be somthing to do with my sketchup
Thanks,
Simon -
ok through the ruby code I recieve the following method after ive just installed sketchup 7 and tryed it in there:
(eval):894: syntax error
status = if UI.toolbar_visible?('GettingStarted') Sketchup.send_action(21992) end
^>
(eval):894
status = if UI.toolbar_visible?('GettingStarted') Sketchup.send_action(21992) end
Error: #<SyntaxError: (eval):894: compile error
(eval):894: syntax error
status = if UI.toolbar_visible?('GettingStarted') Sketchup.send_action(21992) end
^
(eval):894: syntax error
status = if UI.toolbar_visible?('GettingStarted') Sketchup.send_action(21992) end
^>
(eval):894 -
Simon use the code ... /code blocks, so it looks like this:
status = if UI.toolbar_visible?('GettingStarted') Sketchup.send_action(21992) end
The Code button on the post edit toolbar will insert them for you.
-
ok will do thanks dan, sorry just new to forums, well not new joined 2 years ago but not used to it.
-
need to be 3 lines, not all on 1 line, or else you must finish statements with a semi-colon ( ; ).
-
in the console (ver 7
if UI.toolbar_visible?('GettingStarted'); Sketchup.send_action(21992); end
with the toolbar off, does nothing and returns nil.
with the toolbar visible, it hides the toolbar and returns true.
-
great that worked in sketchup 7, however when I put it inside of my .rb file it dosnt work. to test it out could I simply just add a new .rb file inside of the plugins folder and inside there put:
status = if UI.toolbar_visible?('GettingStarted') Sketchup.send_action(21992) end
-
ok I have got:
if UI.toolbar_visible?('GettingStarted'); Sketchup.send_action(21992); end
working in my v6 through the ruby console however how come when I put it inside of my .rb file it does not work?
could there be errors?
-
@simonstaton said:
to test it out could I simply just add a new .rb file inside of the plugins folder and inside there put:
status = if UI.toolbar_visible?('GettingStarted') > Sketchup.send_action(21992) > end
Yes I put things like this in a rb called "!Defaults.rb"
The exclamation makes it load before alpha characters because of the position of ! in the ASCII set.Also you don't need "status =" if you will not use the status reference.
Advertisement