sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Registering a Scrambled Extension

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 3 Posters 427 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.
    • 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

      1 Reply Last reply 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

        1 Reply Last reply 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.

          1 Reply Last reply 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

            1 Reply Last reply 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

              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