sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🚨 Skimp | 25% Off until March 30 Buy Now

    Help: Paths & Co

    Scheduled Pinned Locked Moved Developers' Forum
    2 Posts 2 Posters 366 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

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • 1 / 1
        • First post
          Last post
        Buy SketchPlus
        Buy SUbD
        Buy WrapR
        Buy eBook
        Buy Modelur
        Buy Vertex Tools
        Buy SketchCuisine
        Buy FormFonts

        Advertisement