sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Extension manager hooks?

    Scheduled Pinned Locked Moved Developers' Forum
    8 Posts 5 Posters 228 Views 5 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.
    • A Offline
      avariant
      last edited by

      The release notes for M2 state this:

      @unknownuser said:

      "Ruby plugin hooks: In addition to the above functionality, we have added several API hooks to allow Developers to more easily write their own Ruby extension managers."

      I haven't been able to find any info about this on the sketchup blogs, here at sketchucation, the API docs, or anywhere. Does anyone know what this new functionality is?

      1 Reply Last reply Reply Quote 0
      • D Offline
        driven
        last edited by

        basically, if you zip your my.rb and rename it my.rbz, SU Extension Manager will load it from your 'download destination' directly into 'Plugins', saving your Users all the grief of what do I put where.

        and some other bits...

        john

        learn from the mistakes of others, you may not live long enough to make them all yourself...

        1 Reply Last reply Reply Quote 0
        • A Offline
          avariant
          last edited by

          The release docs list the zip stuff separately from the "API hooks". And the zip integration wouldn't be have anything to do with the API anyway. I think they must be talking about something different, at least it certainly sounds like it to me.

          1 Reply Last reply Reply Quote 0
          • D Offline
            driven
            last edited by

            @avariant said:

            zip integration wouldn't be have anything to do with the API anyway.

            they had to rewrite a bit of the API and authors have write/re-write their scripts via the API to use those 'new' hooks effectively, but there is other stuff coming, I'm sure... john

            learn from the mistakes of others, you may not live long enough to make them all yourself...

            1 Reply Last reply Reply Quote 0
            • TIGT Offline
              TIG Moderator
              last edited by

              The .rbz file format can be 'auto-installed' via Preferences even it it's NOT an 'Extension'...
              I already asked Google to rephrase the wording on that button... but to no avail...

              This means that any script packaged as a .rbz format file can be [relatively] painlessly installed using that button using the Preferences option [in an appropriate v8+++]... however, those that are made as proper 'Extensions' offer the user the ability to switch the tools on and off via Preferences...

              TIG

              1 Reply Last reply Reply Quote 0
              • A Offline
                avariant
                last edited by

                @tig said:

                however, those that are made as proper 'Extensions' offer the user the ability to switch the tools on and off via Preferences...

                But this isn't new, right? This has been available for a long time...

                1 Reply Last reply Reply Quote 0
                • J Offline
                  Jim
                  last edited by

                  
                  Sketchup.install_from_archive("C;/Folder/Plugin.[rbz|zip]") # unzips an .rbz or .zip archive to the Plugins folder.
                  Skethcup.plugins_disabled=(true|false) # enable/disable loading of the Plugins folder on next start.
                  Skethcup.plugins_disabled?
                  Sketchup.extensions #- returns the list of SketchupExtension objects
                  Sketchup.extensions[name_or_index]
                  Sketchup.extensions.methods
                  ["select", "partition", "grep", "reject", "member?", "find", "each_with_index", "collect", "all?", "length", "entries", "detect", "zip", "map", "any?", "size", "sort", "count", "min", "find_all", "each", "inject", "keys", "sort_by", "max", "[]"]
                  SketchupExtension.new.methods - Object.methods
                  ["description=", "copyright", "copyright=", "loaded?", "version", "version=", "check", "load_on_start?", "load", "name=", "registered?", "register_from_sketchup", "creator", "uncheck", "creator=", "unload", "description"]
                  
                  

                  My understanding is that at least some of the SketchupExtension instance methods are meant to be called by SketchUp rather than by plugins.

                  Hi

                  1 Reply Last reply Reply Quote 0
                  • Dan RathbunD Offline
                    Dan Rathbun
                    last edited by

                    @jim said:

                    My understanding is that at least some of the SketchupExtension instance methods are meant to be called by SketchUp rather than by plugins.

                    Yep.

                    If interested, just read comments in the new extensions.rb file in the Tools dir.

                    I'm not here much anymore.

                    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