sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    How to add item to a menu created by another plugin

    Scheduled Pinned Locked Moved Developers' Forum
    6 Posts 3 Posters 267 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.
    • ppoublanP Offline
      ppoublan
      last edited by

      Dear all,
      I'm trying to test existence of a menu created by another plugin.
      The goal is to share same menu from different plugins, and create the menu if not already done by the other plugin, and add items to it.
      UI.menu returns id for plugins menu. Can it be used for non Sketchup menus ?
      I made some tests but did not succeeded. Has somebody already done this ?
      Yours
      Pascal

      1 Reply Last reply Reply Quote 0
      • tt_suT Offline
        tt_su
        last edited by

        Unfortunately this is currently not possible due to limitations of how menus are initialized internally in SketchUp.

        Can you describe the use case for adding your own menu items to another plugin's menu?

        1 Reply Last reply Reply Quote 0
        • ppoublanP Offline
          ppoublan
          last edited by

          Hi Tom,
          The goal is to share menus between 2 plugins (for exemple 2 plugins from the same author), but that can be installed separately with no require link from one to the other.
          Idealy they (each plugin) even dont need to know the existence of the other, but want to share same submenu to not add too long list to the SU Plugins Menu.
          Any idea appreciated.
          Yours
          pascal

          1 Reply Last reply Reply Quote 0
          • tt_suT Offline
            tt_su
            last edited by

            If one of the plugins store the reference to it's submenu to and instance variable and implement a getter for that then it is possible for another plugin to get that plugin and attach more menus during startup. However, you only get once chance. After SketchUp has loaded the plugins during startup the menu references are useless.

            1 Reply Last reply Reply Quote 0
            • Chris FullmerC Offline
              Chris Fullmer
              last edited by

              I do this with my plugins. They all get installed in a submenu called "CLF Tools" or something. It is possible because I know how to check to see if that submenu object exists. Then add to it if it does exist, or create it if it does not exist.

              So if you want to create a generic submenu system that others can use, like "Edge Plugins", you would have to set that up and others would have to implement your same system. In other words, the idea of plugins not knowing about the existence of one another is not likely, since they would have to work together.

              Lately you've been tan, suspicious for the winter.
              All my Plugins I've written

              1 Reply Last reply Reply Quote 0
              • ppoublanP Offline
                ppoublan
                last edited by

                @chris fullmer said:

                I do this with my plugins. They all get installed in a submenu called "CLF Tools" or something.

                This is what I would like to achieve.

                @chris fullmer said:

                It is possible because I know how to check to see if that submenu object exists. Then add to it if it does exist, or create it if it does not exist.

                Do not understand how you do this if the other plugin is not installed or not already loaded by SU ?
                But I will have a look at Edge to see if I understand how it works.
                Thanks for your answer
                Pascal

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

                Advertisement