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

    Register_extension error

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 2 Posters 779 Views 2 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
      dmac100
      last edited by

      Hi,

      I've submitted an update to an extension but I'm getting an exception back from the review. This seems to be within Sketchup::require call but I can't reproduce this. I don't see what the "Error: #" at the top means, normally there would be more information. This was previously working and the files involved haven't changed. Maybe there's something new in Sketchup 2016. Anyone see what could be causing this?

      
      Error; #
      C;/Program Files/SketchUp/SketchUp 2016/Tools/extensions.rb;197;in `require'
      C;/Program Files/SketchUp/SketchUp 2016/Tools/extensions.rb;197;in `load'
      C;/Users/tthomas2/AppData/Roaming/SketchUp/SketchUp 2016/SketchUp/Plugins/greenspaceLive_gModeller.rb;24;in `register_extension'
      C;/Users/tthomas2/AppData/Roaming/SketchUp/SketchUp 2016/SketchUp/Plugins/greenspaceLive_gModeller.rb;24;in `'
      C;/Program Files/SketchUp/SketchUp 2016/Tools/sketchup.rb;85;in `require'
      C;/Program Files/SketchUp/SketchUp 2016/Tools/sketchup.rb;85;in `block in require_all'
      C;/Program Files/SketchUp/SketchUp 2016/Tools/sketchup.rb;85;in `each'
      C;/Program Files/SketchUp/SketchUp 2016/Tools/sketchup.rb;85;in `require_all'
      ;in `
      '
      
      
      
      # gModeller Plugin from Greenspace Research
      require 'sketchup.rb'
      Sketchup;;require 'extensions.rb' #Import the SketchUp extension class
      
      # Work around SketchUp2014 bug where opening a file from a different drive results in the wrong drive letters in the load path.
      if Sketchup.version =~ /^14\.0/
      	toolsPath = $LOAD_PATH.find { |x| x =~ /Tools$/ }
      	if toolsPath and not $LOAD_PATH.include?(toolsPath + '/RubyStdLib')
      		$LOAD_PATH << toolsPath + '/RubyStdLib'
      		$LOAD_PATH << toolsPath + '/RubyStdLib/platform_specific'
      	end
      end
      
      extensionName = "GreenspaceLive gModeller"
      
      ext = SketchupExtension.new(extensionName, Sketchup.find_support_file('main.rb', 'Plugins/greenspaceLive_gModeller/LiveEnergy-Classes/'))
      
      ext.name = "GreenspaceLive gModeller"
      ext.description = "GreenspaceLive's gModeller tool for Trimble SketchUp"
      ext.version = "1.12"
      ext.creator = "GreenspaceLive"
      ext.copyright = "2016, GreenspaceLive"
      
      Sketchup.register_extension(ext, true)
      
      
      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        What's wrong with some simpler coding e.g.
        require("extensions.rb")
        and later on...
        ` ext = SketchupExtension.new(extensionName, "greenspaceLive_gModeller/LiveEnergy-Classes/main.rb")

        ext.name = extensionName`

        Otherwise I see no immediate cause for errors...

        TIG

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

          @tig said:

          What's wrong with some simpler coding e.g.
          require("extensions.rb")
          and later on...
          ` ext = SketchupExtension.new(extensionName, "greenspaceLive_gModeller/LiveEnergy-Classes/main.rb")

          ext.name = extensionName`

          Otherwise I see no immediate cause for errors...

          Yes, I should change that.

          I've re-downloaded the submitted installer, it includes a 'main.rbs' instead of a 'main.rb' file like we had before, so I think that is the problem. It's probably just not finding that file.

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

            If the RB is going to be encrypted use this:
            ext = SketchupExtension.new(extensionName, "greenspaceLive_gModeller/LiveEnergy-Classes/main")
            SketchUp automatically finds a matching file RB or RBS...

            You never mentioned that as a possible scenario... πŸ˜’

            If you have other RB files encrypting in the subfolder[s], then also ensure you use:
            Sketchup::require(name_without_filetype_suffix) rather than ' load()'...
            This way the RB files load during testing AND the RBS files still work after the encryption...

            You have to plan ahead. πŸ€“

            TIG

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

              @tig said:

              If the RB is going to be encrypted use this:
              ext = SketchupExtension.new(extensionName, "greenspaceLive_gModeller/LiveEnergy-Classes/main")
              SketchUp automatically finds a matching file RB or RBS...

              You never mentioned that as a possible scenario... πŸ˜’

              If you have other RB files encrypting in the subfolder[s], then also ensure you use:
              Sketchup::require(name_without_filetype_suffix) rather than ' load()'...
              This way the RB files load during testing AND the RBS files still work after the encryption...

              You have to plan ahead. πŸ€“:

              Thanks, that should be the only change I need. I was already using encryption but forgot that main.rb was excluded from the encryption on my local copy.

              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