• Login
sketchucation logo sketchucation
  • Login
⚠️ Libfredo 15.4b | Minor release with bugfixes and improvements Update

Modifying existing menu items in sketchup

Scheduled Pinned Locked Moved SketchUp Discussions
sketchup
8 Posts 3 Posters 951 Views 3 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.
  • D Offline
    Disha1708
    last edited by 6 May 2020, 14:47

    Hey guys!!
    I have just started making extensions for sketchup using Ruby. I wanted to know if there was anyway, maybe using a ruby code, that I can disable an existing menu item. I actually need the Save and Save as options in the file menu to get disabled or grayed when the extension I've designed, is run.
    From all the research I've done, I've only seen a way to add a menu item and then disable or gray the added item using "MF_GRAYED". But I wanted to do this to already existing menu item.
    Please kindly help me if this is possible.
    Thankyou.

    1 Reply Last reply Reply Quote 0
    • T Offline
      TIG Moderator
      last edited by 6 May 2020, 15:21

      It's only possible to do it to your own extensions/methods.
      The native ones and those by other authors are inaccessible to you...
      😞

      TIG

      1 Reply Last reply Reply Quote 0
      • D Offline
        Disha1708
        last edited by 7 May 2020, 07:39

        That's unfortunate but thank you so much for letting me know.
        If disabling is not possible for native items, is it possible to trigger my extension when the save button is clicked?
        The reason is I need my extension to be run just before I save and close a sketchup file.

        1 Reply Last reply Reply Quote 0
        • D Offline
          Dave R
          last edited by 7 May 2020, 12:07

          If you are saving by clicking on the toolbar's Save button, why don't you just remove that toolbar and replace it with your own that includes you own custom Save button?

          Etaoin Shrdlu

          %

          (THERE'S NO PLACE LIKE)

          G28 X0.0 Y0.0 Z0.0

          M30

          %

          1 Reply Last reply Reply Quote 0
          • D Offline
            Disha1708
            last edited by 7 May 2020, 13:01

            But by doing that, I will still have the option of going to the file menu and then clicking save.
            The extension I've made is actually an encryption method, and I don't want anyone who uses the file to be able to save it without encrypting it.

            1 Reply Last reply Reply Quote 0
            • T Offline
              TIG Moderator
              last edited by 7 May 2020, 14:14

              Your extension could use an observer which spots that SketchUp is closing and then runs itself ?
              Perhaps an AppObserver [or perhaps a ModelObserver] ??

              TIG

              1 Reply Last reply Reply Quote 0
              • D Offline
                Disha1708
                last edited by 7 May 2020, 17:55

                Thank you so much for this suggestion. I checked it out and it seems to be exactly what I needed. I will try it out soon and let you know if it worked.

                1 Reply Last reply Reply Quote 0
                • D Offline
                  Disha1708
                  last edited by 8 May 2020, 09:15

                  It worked perfectly. Thank you so much!!

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  1 / 1
                  • First post
                    1/8
                    Last post
                  Buy SketchPlus
                  Buy SUbD
                  Buy WrapR
                  Buy eBook
                  Buy Modelur
                  Buy Vertex Tools
                  Buy SketchCuisine
                  Buy FormFonts

                  Advertisement