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!
    Urasik Extensions | Lots of new extensions to check out Learn More

    Failed saving image on plugin directory. (solved)

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 1 Posters 253 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

          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