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!
    ⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update

    Failed saving image on plugin directory. (solved)

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 1 Posters 214 Views 1 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.
    • renderizaR Offline
      renderiza
      last edited by renderiza

      Is there a way to save image inside the folder in plugin directory specified in code?

      I can save in folder outside plugin directory but not sure what folder dir is compatible with MAC and WIN. Only way is to call File.dirname(FILE)...any ideas?

      
      @@path = File.dirname(__FILE__) # this plugin's folder
      @@export_files = File.join(@@path, '/ExportFiles/')
      
      if params['antialias'].to_s == "true"
      @anti = true
      else
      @anti = false
      end
      					
      if params['transparent'].to_s == "true"
      @trans = true
      else
      @trans = false
      end
      
      keys = {
      ;filename => "#{@@export_files}write_image.#{params['sel_type'].to_s}",
      ;width => params['getwidth'].to_i,
      ;height => params['getheight'].to_i,
      ;antialias => @anti,
      ;compression => 0.9,
      ;transparent => @trans
      }
      model = Sketchup.active_model
      view = model.active_view
      view.write_image keys
      

      [url=https://www.sketchupcode.com/:z3kqsidd]My Extensions ...[/url:z3kqsidd]

      1 Reply Last reply Reply Quote 0
      • renderizaR Offline
        renderiza
        last edited by

        Interesting... When I use UI.savepanel and find that folder on plugin directory I can see the images but with a lock icon on the corner. If I browse that folder normally I don't see anything inside.

        [url=https://www.sketchupcode.com/:z3kqsidd]My Extensions ...[/url:z3kqsidd]

        1 Reply Last reply Reply Quote 0
        • renderizaR Offline
          renderiza
          last edited by

          Hi,

          Doing some research I found this post by TIG and it was pretty much what I was looking for.

          http://sketchucation.com/forums/viewtopic.php?p=281017#p281017

          Thanks!

          [url=https://www.sketchupcode.com/:z3kqsidd]My Extensions ...[/url:z3kqsidd]

          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