sketchucation logo sketchucation
    • Login
    1. Home
    2. draftomatic
    3. Posts
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    D
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 25
    • Posts 116
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: MR2 broke plugin during C extension require

      Thanks Dan.

      So, per your suggestion, I started going through the libraries that require 'openssl' and replacing it with Sketchup.require 'openssl'

      It seemed to fixed one after the other, until I got this:

      Error Loading File C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/Light Stanza/lib/Ruby186/lib/ruby/1.8/i386-mswin32/openssl.so 126: The specified module could not be found. - C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/Light Stanza/lib/Ruby186/lib/ruby/1.8/i386-mswin32/openssl.so

      Sorry, had a copy/paste error a second ago. Fixed it.

      posted in Developers' Forum
      D
      draftomatic
    • RE: MR2 broke plugin during C extension require

      require('openssl') Error: #<LoadError: C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/Light Stanza/lib/Ruby186/lib/ruby/1.8/i386-mswin32/openssl.so: 126: The specified module could not be found. - C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/Light Stanza/lib/Ruby186/lib/ruby/1.8/i386-mswin32/openssl.so> (eval) C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/Light Stanza/lib/Ruby186/lib/ruby/1.8/openssl.rb:17 (eval):0:inrequire'
      (eval):0
      Sketchup.require('openssl')
      false`

      Interesting... does that mean anything to you? The latter returned false. Was it successful or no?

      posted in Developers' Forum
      D
      draftomatic
    • RE: MR2 broke plugin during C extension require

      @dan rathbun said:

      By the way.. what are the green checkmarks over the folder icons mean ?

      It's TortoiseSVN (I use SVN for version control). It doesn't modify the files and has never been a problem in over 200 revisions.

      posted in Developers' Forum
      D
      draftomatic
    • RE: MR2 broke plugin during C extension require

      Hmm well I just reinstalled SketchUp to this version:

      http://www.filehippo.com/download_google_sketchup/8248/

      And it still can't find openssl.so

      So perhaps it's not a problem with MR2...

      posted in Developers' Forum
      D
      draftomatic
    • RE: MR2 broke plugin during C extension require

      @dan rathbun said:

      require('openssl')

      This gives the same error.

      posted in Developers' Forum
      D
      draftomatic
    • RE: MR2 broke plugin during C extension require

      @dan rathbun said:

      Let's see the light_stanza_extension.rb file, please.

      Does it use a path with backslashes, or forward slashes ??

      The error is only showing that file because it's the entry point for the plugin. I'm not requiring anything in that file, and certainly not openssl.so.

      It's nested several requires later, when I require the RestClient library, which is a 3rd-party library which itself includes openssl.

      posted in Developers' Forum
      D
      draftomatic
    • RE: MR2 broke plugin during C extension require

      Ah, so I needed to leave off the ".so" part of the path.

      So that was the problem using loadin the Ruby console, but now the file is not found (which actually is the error I was having originally but then I started getting the other one in the console).

      Getting this error now:

      Error Loading File light_stanza_extension.rb 126: The specified module could not be found. - C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/Light Stanza/lib/Ruby186/lib/ruby/1.8/i386-mswin32/openssl.so

      I attached a screenshot as proof the file does exist in the correct folder and that my load paths are correct.


      openssl not found.PNG

      posted in Developers' Forum
      D
      draftomatic
    • RE: MR2 broke plugin during C extension require

      Hmm, doesn't look like it was.

      RUBY_VERSION 1.8.6 RUBY_PATCHLEVEL 287

      Actually I just upgraded my laptop's SU, which is XP and it's loading. I have tested it on 2 Vista computers (one of which worked before MR2, and the other I did a totally fresh installation of SU and the plugin) and both are broken.

      posted in Developers' Forum
      D
      draftomatic
    • MR2 broke plugin during C extension require

      Before MR2 I was able to load the standard C extensions that we are distributing with our installation. I use some rubygems that require openssl.so, for example.

      After upgrading I'm getting an error:

      load "Light Stanza/lib/Ruby186/lib/ruby/1.8/i386-mswin32/openssl.so" Error: #<SyntaxError: (eval):0:inload': C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/Light Stanza/lib/Ruby186/lib/ruby/1.8/i386-mswin32/openssl.so:1: Invalid char \220' in expression>

      Was the Ruby interpreter updated for this release (1.8.6 patch level on Windows)? It seems to be having trouble reading the libraries.

      posted in Developers' Forum
      D
      draftomatic
    • IO.popen behaving strangely within SU

      Hi all -

      I am trying to run a subprocess from a shell command using IO.popen (have also tried Kernel#system with identical results), and I'm getting odd behavior. Here's my code:

      curl = "curl "
      curl += "--cookie \"JSESSIONID=#{@sessionid}\" "
      curl += "-H \"Content-type;application/octet-stream\" "
      curl += "-X POST "
      curl += "-o \"#{responseFile}\" "
      curl += "--data-binary \"@#{filename}\" "
      curl += "\"#{url}\""
      
      puts "command; #{curl}"
      
      IO.popen(curl, "r") { |out|
        out.readlines
      }
      # Script never makes it to here
      

      It's a streaming file upload using curl. Curl starts uploading, sends about 100kb, which is received by my server, and suddenly the stream ends ("unexpected end of stream error" on the server-side). Curl keeps running endlessly, sending zero data after that. Since I'm blocking with readlines, SU is forever frozen from then on...

      I have tried this same code in a standalone script as well as running the command directly from a shell, and both work fine.

      Anyone encountered this before? SU doesn't seem to like subprocesses...

      EDIT: I should note this is on OSX.

      posted in Developers' Forum
      D
      draftomatic
    • RE: Webdialog

      I heard Dan Rathbun or someone was toying with getting Chrome Frame working in SU.

      posted in Developers' Forum
      D
      draftomatic
    • RE: Unique identifier for model?

      Yes the problem comes when you have multiple SU processes running (I'm guessing users do this more on OSX because of the way windows are managed). So when the plugin starts and tries to delete tempfiles, there could be another SU using it. Hence the file lock.

      posted in Developers' Forum
      D
      draftomatic
    • RE: Unique identifier for model?

      @thomthom said:

      @draftomatic said:

      EDIT: Actually I need to generate a tempfile per-model and I'm looking for a unique name that I don't need to manage myself...

      So you just need a unique string? Don't you think the model.guid is unique enough?
      dc85e69e-a682-4e47-832e-3c5c53772e42

      I will probably do this; I was just hoping there was a way to get a unique model id that sketchup keeps track of...

      The problem of tempfile deletion has become more interesting. I think my solution above will work, which may be useful to others since I see other sketchucation posts about this and nobody seems to have a good solution.

      posted in Developers' Forum
      D
      draftomatic
    • RE: Unique identifier for model?

      How about this:

      Use a lock file. When the plugin starts, create a locked file with File.flock(File::LOCK_EX) if it doesn't exist. If it does, check for an existing lock with File.flock(File::LOCK_NB|File::LOCK_EX). This will return false if it's locked, or if not, it returns 0 and obtains a lock.

      If there is a lock, then another instance of SU is open, so don't delete tempfiles.

      I tested this in irb and it seems to work.

      posted in Developers' Forum
      D
      draftomatic
    • RE: Unique identifier for model?

      I actually don't need the identifier to tie back to the model, only one-way so that I can delete the tempfile when I'm done using it. So I don't need to save anything on the model and therefore modify it for saving.

      Anyway, sounds like you are managing the ID's yourself... I was hoping to avoid that.

      posted in Developers' Forum
      D
      draftomatic
    • Unique identifier for model?

      Can anyone think of a way to get a unique id for a model?

      Model.guidsays it changes when the model is saved. I'd like it to stay the same...

      EDIT: Actually I need to generate a tempfile per-model and I'm looking for a unique name that I don't need to manage myself...

      posted in Developers' Forum
      D
      draftomatic
    • RE: Getting Ruby to work on Mac

      @dan rathbun said:

      If I was a Mac only user, I'd be raisin' hell... getting a petition going, or similar to get the Mac Sketchup Ruby updated (at least equal to that of the PC.)

      It would be nicer if both platforms were updated to the latest patch in the 1.8.7 trunk.

      I am in the process of raising hell to Google... 😃

      @dan rathbun said:

      It would be beneficial if you could figure out a way, to install an additional frameworkized v1.8.7 Ruby beneath (alongside) the Sketchup obsolete Ruby, and then have a "switching" utility that allowed the user to change the symbolic links, to load the newer Ruby.

      Sigh... these convoluted workarounds are getting old. I think it will be resort to using shell commands instead of the Ruby libraries I need. Mac comes with curl and gzip, and I believe this will eliminate my need for stringio as well.

      Thank you for your input Dan. I will pass this on to Google.

      posted in Developers' Forum
      D
      draftomatic
    • RE: Getting Ruby to work on Mac

      @chris fullmer said:

      Isn't it possible to just copy the files you need and require them in your own script? How many standard library files is it?

      I really need a full Ruby installation, including all the C extensions (zlib, stringio, thread, bigdecimal, etc... about 10-15 in total). I achieved this on the PC by copying a 1.8.6 installation into my plugin files.

      So yes, I could copy files, but my Mac comes with 1.8.7, and the existing extensions in that installation do not work in SketchUp (I get a version difference error). I'm therefore trying to compile a version that will work in SketchUp, but all the 1.8.5 sources I find are missing the thread C extension.

      posted in Developers' Forum
      D
      draftomatic
    • RE: Getting Ruby to work on Mac

      Thanks Dan.

      Unfortunately since I'm distributing my plugin to other people, I don't see a way to replace the interpreter such that other plugins will be guaranteed not to break. Upgrading SU's Ruby is really only a reasonable solution if you're doing it to YOUR SketchUp and not others'.

      Unless you have something in mind... But otherwise I am still looking for a way to get 1.8.5 standard libraries and extensions into my Mac SU.

      posted in Developers' Forum
      D
      draftomatic
    • RE: How to force IE 8 or 9?

      From the Lost Manual:

      @unknownuser said:

      Beware that the user agent string will still report MSIE 7.0 for embedded WebBrowsers - even though you use IE8 mode. This differs from when you test the same HTML in the normal web browser where it returns MSIE 8.0. To check the rendering mode: document.documentMode.

      This tripped me up. Looks to be working.

      Thanks ThomThom!

      posted in Developers' Forum
      D
      draftomatic
    • 1 / 1