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

    Help: Paths & Co

    Scheduled Pinned Locked Moved Developers' Forum
    2 Posts 2 Posters 273 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.
    • schorradtS Offline
      schorradt
      last edited by Gábor

      I have a problem: I would like a plugin with icons.
      The plugin and the icons are on a network drive, not on the lokal plugins-Folder
      I invite the external plugins with the following script

      
      $GLOBAL_PLUGIN_DIR = "L;/SketchUp/Plugins/"
      def require2_alll(dirname)
          begin
              rbfiles = Dir[File.join(dirname, "*.rb")] 
              rbsfiles = Dir[File.join(dirname, "*.rbs")]
              $;.push dirname
              rbfiles.each {|f| require f}
              rbsfiles.each {|f| require f}
          rescue
              puts "could not load files from #{dirname}"
          end
      end
      require2_alll $GLOBAL_PLUGIN_DIR
      
      

      The plugins are loaded, but I do not load the icons

      Is there another solution to plugins completely put on a network drive?
      I think within the scripts, the paths will not.

      I'm sorry for the bad English, but I hope someone understands it.


      http://www.henryschorradt.de/

      1 Reply Last reply Reply Quote 0
      • fredo6F Offline
        fredo6
        last edited by

        Only the Ruby method "Require" and "Load" use the globals $: and $".
        For other methods loading files such as icons or images, the path is taken from the method arguments, without reference to the absolute path of Ruby in $:.
        In addition, several plugins assume that they are located in the Sketchup Plugin folder to compute path to files to be loaded. This is the case for my plugins in current versions (I am changing the strategy for my next versions however).

        The question of alternate directory for Pluginsis anyway very interesting, because:

        • this allows to sahre plugins between different version of Sketchup (useful when we have SU6 and SU7, with pro and Free versions)
        • on Windows Vista, you have to configure some security rules in order to copy and write to files loacted in the C:/Program Files(x86).
        • in network configurations or in some offices, the access to the 😄 drive may simply be prohibited

        So using an alternate folder on a private drive gives a lot more flexibility. Technically, it is just a matter of respecting some programming rules. But, for users that are not able to write scripts, there must be some conventions for providing an esay configuration tool for Sketchup to tell where scripts are.

        This deserves reflection and I am sure that the community of Ruby scripters could come with a solution.

        Fredo

        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