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

    Plugins Locations

    Scheduled Pinned Locked Moved Developers' Forum
    19 Posts 5 Posters 1.2k 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.
    • Al HartA Offline
      Al Hart
      last edited by

      @tt_su said:

      Can you give some more background for this error? Are you creating a string from ENV or FILE for the filename you want to load?

      To duplicate a problem we are having with a client, I created a user on my machine with an extended ASCII character in the name (using a word from a path in the users AppData location).

      The user name is: aplikacíX (but there is a hex 0xa1 in front of the X. (Here is a hex dump)

      C:\AA>echo aplikacíX| od -hc
      0000000 7061 696c 616b a163 0d58 000a
      a p l i k a c 241 X \r \n

      I then used find_support_file() to get the complete path of a file name in Plugins:

      sdll = Sketchup.find_support_file('Plugins/RPS_win32_IRender_nXt.so')

      sdll was set to: C:/Users/aplikacíX/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/RPS_win32_IRender_nXt.so

      I then passed the name on to require

      require sdll

      and I get this error:

      Error: #<Encoding::CompatibilityError: incompatible character encodings: Windows-1252 and UTF-8>
      C:/Program Files (x86)/SketchUp/SketchUp 2014/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb:109:in end_with?' C:/Program Files (x86)/SketchUp/SketchUp 2014/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb:109:in rescue in require'
      C:/Program Files (x86)/SketchUp/SketchUp 2014/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb:35:in `require'

      It is possible that the error is with a call in the .so file. I'll try to find a way to check that out.

      Al Hart

      http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
      IRender nXt from Render Plus

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

        Ah! yes, the loading binary libraries issue. We have a fix for that coming up.

        1 Reply Last reply Reply Quote 0
        • Al HartA Offline
          Al Hart
          last edited by

          @dan rathbun said:

          This IS expected... a user can copy a shared plugin to THEIR OWN plugin folder, and tweak it for their own use. THEIR edition then loads for THEM only, without affecting the edition that is shared by other users.

          That was pretty clever! - Letting the User have his own version and it works well for APPDATA and ProgramData.

          But if the same rubies happen to be in a SketchUp 2014 Plugins folder in Program Files, then find_support_file() finds them instead. (I understand that no one is supposed to place anything in the SketchUp Plugins folder in Program Files - but you can imagine why users using SketchUp 2014 for the first time might copy their old Plugins folder into SketchUp 2014 in Program files)

          I placed identical ruby files - one in Plugins and one in a sub-folder of Plugins - in APPDATA and in ProgramData - and the AppData ones got run properly. (Using find_support_file() to get the full path of the second file worked properly)

          However, when I placed the same files in Program Files as well (the same rubies in all 3 locations), and used get_support_file() to try to find the second ruby file, then it messed up and found the one in Program Files. When SketchUp started up, it ran the first ruby file from APPDATA, but find_support_file found the one in Program Files instead of the one in APPDATA.

          I created two ruby files, rps_level1.rb uses find_support_file() to locate rps_level2.rb and then runs it.

          rps_level1.rb - placed in Plugins:

          ` SKETCHUP_CONSOLE.show
          printf("\n-----------------------\n")
          printf("IN: %s\n", FILE)

          printf("\nIN: 'RPS/rps_level2.rb'\n")

          $sfull_path = Sketchup.find_support_file('Plugins/RPS/rps_level2.rb').to_s

          printf("\nLOADING FULL PATH: %s\n", $sfull_path)

          load ($sfull_path)`

          rps_level2.rb placed in the Plugins/RPS sub folder:

          printf("IN rps_level2.rb: %s\n", __FILE__)

          When duplicate files were placed in APPDATA and ProgramData only the ones in APPDATA were executed:

          ` -----------------------
          IN: C:/Users/Al/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/rps_level1.rb

          LOADING FULL PATH: C:/Users/Al/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/RPS/rps_level2.rb
          IN rps_level2.rb: C:/Users/Al/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/RPS/rps_level2.rb`

          But when I placed a third copy in Program Files Plugins, find_support_file found the one in Program Files and ran it instead.

          (Sketchup.find_support_file() called from APPDATA returned the path in Program Files.)

          ` -----------------------
          IN: C:/Users/Al/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/rps_level1.rb

          LOADING FULL PATH: C:/Program Files (x86)/SketchUp/SketchUp 2014/Plugins/RPS/rps_level2.rb
          IN rps_level2.rb: C:/Program Files (x86)/SketchUp/SketchUp 2014/Plugins/RPS/rps_level2.rb`

          Al Hart

          http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
          IRender nXt from Render Plus

          1 Reply Last reply Reply Quote 0
          • S Offline
            swapb
            last edited by

            Hi,

            I am a newbee in sketchup plugin development and I am facing an issue with sketchup 2014.
            My plugin dll is not geeting loaded in su2014,which used to get loaded without any errors till su2013.

            I am getting the following error messages

            Error Loading File sketchupConnector
            Could not find included file 'sketchupConnector'
            Error Loading File C:/Users/damayantib/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/eDrawings/edpublisher.rb
            Error: #<NoMethodError: undefined method check_license' for Sketchup::EDrawingsTools:Module> C:/Users/damayantib/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/eDrawings/edpublisher.rb:583:in module:EDrawingsTools'
            C:/Users/damayantib/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/eDrawings/edpublisher.rb:5:in <top (required)>' C:/Program Files (x86)/SketchUp/SketchUp 2014/Tools/extensions.rb:197:in require'
            C:/Program Files (x86)/SketchUp/SketchUp 2014/Tools/extensions.rb:197:in `load'

            Can anyone help me with this issue!!!

            Thanks in advance.

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

              SketchUp changed from Ruby 1.8 to Ruby 2.0 in version 2014. So you need to make sure all binaries are compatible with the updated Ruby interpreter.

              1 Reply Last reply Reply Quote 0
              • S Offline
                swapb
                last edited by

                I have tried that too.I have changed the thirdparty from ruby1.8 to ruby2.0 and built my project in vs2010, but the error persists.

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

                  Hmm... the error actually complains about a file not found...

                  Could not find included file 'sketchupConnector'

                  And an undefined method...

                  Hard to tell without knowing anything about the extension. But I'd trace down the missing method and file.

                  Have you tried the Ruby Debugger - letting you step through Ruby code?
                  https://github.com/SketchUp/sketchup-ruby-debugger

                  1 Reply Last reply Reply Quote 0
                  • S Offline
                    swapb
                    last edited by

                    Hi,

                    I have created a sample extension .This is my Samplemenus.rb file.
                    I am not getting the message box when I click on 'publish'.Am I missing something here.
                    I guess the syntax is wrong somewhere. plz help.

                    require 'sketchup.rb'
                    module Sketchup::Sampletool

                    if defined?(Sketchup::Set)
                    Set = Sketchup::Set
                    end

                    PLUGIN = self

                    def pop_message
                    UI.messagebox('Hit')
                    end
                    #------------------------------------------------------------------------------

                    Add things to the Utilities menu

                    if( not $edrawings_menu_loaded )
                    sample_menu = UI.menu("Plugins").add_submenu("sample")
                    sample_menu.add_item("Publish") {pop_message }
                    $edrawings_menu_loaded = true
                    end

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

                      Try using:
                      **self.**pop_message
                      instead...

                      BUT please don't mess with the 'Sketchup' module - make your own module e.g. 'SWAPB'
                      Also don't use unnecessary global-variables like $edrawings_menu_loaded, they can be replaced in this instance with something like...

                      unless file_loaded?(__FILE__)
                        ...
                        file_loaded(__FILE__)
                      end
                      

                      Why do you need to redefine Set ?

                      Also this is NOT an 'Extension', it some simple Ruby plugin code to add a menu item and make a messagebox etc...

                      Also learn to put your post's code inside [code] or [ ruby] blocks... like my snippets above...

                      TIG

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

                        .. and the nested module definition has no end closure.

                        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