sketchucation logo sketchucation
    • Login
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download

    Registering a Scrambled Extension

    scheduled pinned locked moved Developers' Forum
    5 Posts 3 Posters 444 Views 3 Watching
    loading-more-posts
    • oldest-to-newest
    • newest-to-oldest
    • most-votes
    reply
    • reply-as-topic
    guest-login-reply
    deleted-message
    • M Offline
      mocathe1st
      last edited by

      Hello,

      I was just wondering if anyone could tell me if its possible to register a scrambled extension (where the ruby files are in .rbs format) using the SketchUp extension registering api.

      e.g. from the docs, the following line registers an extension:

      # Create an entry in the Extension list that loads a script called
           # stairTools.rb.
           require 'sketchup.rb'
           require 'extensions.rb'
      
           stair_extension = SketchupExtension.new "Stair Tools", "utils/stairTools.rb"
           stair_extension.version = '1.0'
           stair_extension.description = "Tools to draw stairs automatically."
           Sketchup.register_extension stair_extension, true
      

      but what if the ruby file was stairTools.rbs? I've tried just substitiuting the file extension for the .rbs one in my plugin but I just get an error message about the file not being found.

      Does anyone have any ideas as to why this would be?

      Thanks,
      Malcolm Murray

      one-reply-to-this-post last-reply-time reply quote 0
      • M Offline
        mocathe1st
        last edited by

        Just wondering if anyone has any solutions for this? I've tried everything I can think of to get the scrambled extension to load up. When I try it with the non scrambled version everything works fine, but when I link SketchupExtension.new to an rbs file it comes back with a message that the file cannot be found even when I know for certain it is there. I've even used Sketchup.find_support_file to get the path to the rbs file I need to load the plugin with but I still get the same error message.

        Has anyone else had any problems with this kind of thing?

        Any help would be most appreciated.

        Thanks,
        Malcolm Murray

        one-reply-to-this-post last-reply-time reply quote 0
        • M Offline
          mocathe1st
          last edited by

          OK, I've kind of sorted this out by not encrypting the file being referenced by SketchupExtension and encrypting the rest. This seems to work for now, but it would be quite nice if you could register encrypted ruby files as extensions.

          one-reply-to-this-post last-reply-time reply quote 0
          • J Offline
            Jim
            last edited by

            I have the same experience. Extensions can't register an encrypted ruby file, so the extensions needs to register a plain-text file, which in turn loads the encrypted file.

            Hi

            one-reply-to-this-post last-reply-time reply quote 0
            • thomthomT Offline
              thomthom
              last edited by

              In my case it appeared to load the .rbs file, but it wrapped everything into the SketchupExtension namespace.

              Thomas Thomassen — SketchUp Monkey & Coding addict
              List of my plugins and link to the CookieWare fund

              one-reply-to-this-post last-reply-time 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