I know that it's very easy to add menu items, tool bars, context menu items with Ruby in Sketchup, but I tried to disable/hide/remove and as far as I can see that's not possible.
Any suggestions?
[Maggy]
is disabling menu items and or tools possible?
7 posts
• Page 1 of 1
is disabling menu items and or tools possible?I know that it's very easy to add menu items, tool bars, context menu items with Ruby in Sketchup, but I tried to disable/hide/remove and as far as I can see that's not possible.
Any suggestions? [Maggy]
Re: is disabling menu items and or tools possible?Remove/Hide: Not on the running process
Grey=Disable: Depends on the script azuby error initus :: Blocks | CurrentDate | d/Code | extensionmanager | FFlipper | HideEdges | MeasuredArea | ModelHistory* | PluginsHelp | PronButton | SAWSO | SCP | SU²CATT
Bad English? PM me, correct me.
Re: is disabling menu items and or tools possible?Thanks.
Grey sounds good enough. But the only grey I can find is in the class Color document. Can you tell me where to find more information? [Maggy]
Re: is disabling menu items and or tools possible?Yes, in the sketchup Ruby API documentation,
http://download.sketchup.com/sketchuphe ... ation_proc But the example is a shame. So have a look on these few lines of code:
An equal usage is possible for toolbar items. azuby error initus :: Blocks | CurrentDate | d/Code | extensionmanager | FFlipper | HideEdges | MeasuredArea | ModelHistory* | PluginsHelp | PronButton | SAWSO | SCP | SU²CATT
Bad English? PM me, correct me.
Re: is disabling menu items and or tools possible?Why didn't I get Ruby in school, when I was 10 years old or so? Now, 40 years later it's very hard to grasp. The most frustrating part it that it looks so easy when I read a perfectly functioning ruby script. But it looks just as easy in a script that's not doing what I expect it to do...
I copied your code to "cornflakes.rb", loaded it, it shows up in Plugins, it adds milk to my cornflakes, but I do not see it grey out any menu item. So I started editing, editing, editing, each time closing SU, restarting it, reloading Cornflakes.rb till the milk and cornflakes were coming out of my ears, but still no greyed out menu items. [Maggy]
Re: is disabling menu items and or tools possible?Maybe because you have to set the @active_model before using the code - like this:
azuby error initus :: Blocks | CurrentDate | d/Code | extensionmanager | FFlipper | HideEdges | MeasuredArea | ModelHistory* | PluginsHelp | PronButton | SAWSO | SCP | SU²CATT
Bad English? PM me, correct me.
Re: is disabling menu items and or tools possible?For me this code works with the additional line. I put it to a .rb file, load Sketchup, try to use Plugins > Cornflakes > Add mild, it is grayed, I open a .skp file and try the same and get my breakfest.
azuby error initus :: Blocks | CurrentDate | d/Code | extensionmanager | FFlipper | HideEdges | MeasuredArea | ModelHistory* | PluginsHelp | PronButton | SAWSO | SCP | SU²CATT
Bad English? PM me, correct me.
SketchUcation One-Liner AdvertsNeed SketchUp Books, Models, Styles or Textures? Check out our One Stop Shop for SketchUp.
Premium Members get 20% discount!
7 posts
• Page 1 of 1
|