sketchucation logo sketchucation
    • Login
    1. Home
    2. jefftrull
    โ„น๏ธ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    J
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 10
    • Groups 1

    jefftrull

    @jefftrull

    10
    Reputation
    1
    Profile views
    10
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    jefftrull Unfollow Follow
    registered-users

    Latest posts made by jefftrull

    • RE: Sketchup Plugin Debugger

      I gave this a try today, with no luck... The instructions say to run "deploy\setup.exe" but there is no such directory. There is a "publish\setup.exe", so I ran that. At the end of the install process it prompted me to supply a pair of filenames to process (input and output, I presume) so I did. The resulting ruby script was identical to the input, except for changes in formatting - in other words, only whitespace differences. No special debug commands were added that I could see, and indeed, when I ran my script it crashed as usual, with no helpful debug popups etc. Also, the documentation refers to a "Debuggified" plugin, but I see no evidence that this was installed. Is it something I am supposed to manually copy?

      If anyone has used this successfully, I would like to hear your install/usage procedure.

      Thanks,
      Jeff

      posted in Developers' Forum
      J
      jefftrull
    • RE: [Tutorial] SketchUp Ruby C Extension

      Today I made a startling discovery: the plugin I built under VS2010 against the 1.8.6-p287 mswin Ruby will load and run without changes in the 1.8.7-p334 mingw build. So the Ruby version and compiler both mismatch, and yet everything works. I'm dumbfounded but delighted, and my previous question is now moot.

      posted in Developers' Forum
      J
      jefftrull
    • RE: [Tutorial] SketchUp Ruby C Extension

      I'm on to the next challenge now... building for the 1.8.7-p334 version my colleagues prefer (better compatibility with certain gems). Unfortunately this one was built with with mingw, and my VS2010 build flow that worked for 1.8.6-p287 (mswin) is not successful here. I have the following results:

      1. build against 1.8.7-p334 built from source with VS2010: compile succeeds, load fails with missing dll msvcrt-ruby18-vc100 (or something like that). If I supply the dll, Sketchup crashes.
      2. build against 1.8.7-p334 one-click install (mingw): compile fails. Lots of warnings about win32.h and missing ruby API functions
      3. hybrid build pointing includes to mswin build of 1.8.7-p334, library from mingw one-click: link error

      I'm under the impression that because dll's use the C API it should be possible to load a VS2010-generated extension into a mingw-built Ruby. Is it a hopeless cause?

      Thanks,
      Jeff

      posted in Developers' Forum
      J
      jefftrull
    • RE: [Tutorial] SketchUp Ruby C Extension

      Let's see how this works for people. Tested only under Windows, although I tried to make the analogous changes for OSX based on my reading of extconf.rb. This file is intended to live under "src" and will create targets for both extensions.


      CMake control file for Sketchup Ruby C Extension

      posted in Developers' Forum
      J
      jefftrull
    • RE: [Tutorial] SketchUp Ruby C Extension

      Thanks again for the helpful information, Dan. I gathered from the "Ruby Interpreter DLLs" link that you can replace the interpreter used by Sketchup with a different one; indeed that seemed to work, but it made no difference in my ability to load the .so file. Still works OK in irb (when the compiler versions match), fails in Sketchup. The good news is it doesn't really matter - I have a working recipe now. The one-click binary is the only thing that's worked for me over all the combinations, and with that, either VS2008 or VS2010 works fine.

      I'm off to turn this into a CMake recipe (this application is cross-platform); would anyone be interested in seeing that when it's done?

      Cheers,
      Jeff

      posted in Developers' Forum
      J
      jefftrull
    • RE: [Tutorial] SketchUp Ruby C Extension

      Thanks again for considering this problem of mine, Dan. As you can see from my previous message, it's now working, but I'm still not sure what was wrong.

      @unknownuser said:

      So (just to be clear:

      1) You installed the 32bit version of Windows 7 ??

      Looks like it. "system properties" says "32-bit operating system"

      @unknownuser said:

      2) Are you running Sketchup with the Google supplied "msvcrt-ruby18.DLL" (which is v1.8.6-p287,) or did you replace the "msvcrt-ruby18.DLL" library file in the Sketchup program dir, with the one that you built ??

      That's an interesting question. I haven't changed anything in the Sketchup program dir, beyond copying the SX_HelloWorld.so into Plugins. What is the significance of those msvcrt* files?

      Thanks,
      Jeff

      posted in Developers' Forum
      J
      jefftrull
    • RE: [Tutorial] SketchUp Ruby C Extension

      thomthom, thanks for your help. I've suddenly found a formula that works. The key thing is to use the Ruby built from the one-click installer you reference in the README http://rubyforge.org/frs/download.php/47082/ruby186-27_rc2.exe
      I hope it doesn't go away anytime soon (it's no longer listed on their index page) - I'm glad you had the direct link, because using either of the two Ruby builds I made from source (one VS2008, one VS2010) fails.

      To answer your questions:

      1. yes, it works in irb for all three Ruby builds without problems
      2. I did the config.h hack for the one-click version, but for the VS2008 and VS2010 I was able to compile the extension with the same version of VC++ I used to build Ruby itself, so it wasn't necessary... I think?
      3. All Ruby versions were 1.8.6-p287, chosen to match SketchUp
      4. The apocryph report relates to the need to embed a manifest into the .so file. Following that advice allowed me to compile under VS2008 - under VS2010 no manifest was produced (and its integration was apparently unnecessary)
      posted in Developers' Forum
      J
      jefftrull
    • RE: [Tutorial] SketchUp Ruby C Extension

      @dan rathbun said:

      BTW your on Windows 7 ??

      That's right, Windows 7 Professional SP1

      @unknownuser said:

      Is the path:
      %(#BF0080)["C:/Program Files(x86)/Google/Google SketchUp 8/Plugins/SX_HelloWorld.so"]

      No, it's "C:/Program Files/Google/Google Sketchup 8/Plugins/SX_HelloWorld.so" (no "(x86)")

      @unknownuser said:

      and what is the result of (at the console):
      puts $LOAD_PATH

      
      puts $LOAD_PATH
      C;/Program Files/Google/Google SketchUp 8/Plugins
      C;/Program Files/Google/Google SketchUp 8/Tools
      nil
      
      

      Thanks!

      posted in Developers' Forum
      J
      jefftrull
    • RE: [Tutorial] SketchUp Ruby C Extension

      Thanks for the quick response! Unfortunately, I don't think that's the issue, for three reasons:

      1. The error message is "The specified module could not be found", rather than "entry point not found"
      2. I'm using the example file from bitbucket unchanged... the name of the relevant function there is "Init_SX_HelloWorld", vs filename "SX_HelloWorld.so"
      3. I can use this module OK in Ruby standalone (whichever one I built with)

      I do think it's got to be something simple... I just can't see what it might be. The error message isn't terribly helpful ๐Ÿ˜ž

      posted in Developers' Forum
      J
      jefftrull
    • RE: [Tutorial] SketchUp Ruby C Extension

      I was so excited to discover that someone was building Sketchup extensions with Visual Studio 2010 - that's exactly what I need to do - unfortunately, after going through the whole process, I can't seem to successfully load the SX_HelloWorld module:

      
      require 'SX_HelloWorld'
      Error; #<LoadError; C;/Program Files/Google/Google SketchUp 8/Plugins/SX_HelloWorld.so; 126; The specified module could not be found.   - C;/Program Files/Google/Google SketchUp 8/Plugins/SX_HelloWorld.so>
      (eval)
      (eval);0
      
      

      Notice this is not a situation where the file is missing - that produces a similar but different error message.

      After some Googling it seemed like missing .so's are sometimes the culprit, so I tried copying over some from my Ruby build directory (win32ole.so and Win32API.so), but it didn't help. Finally I tried running Sketchup from the VS2010 command line shell - this resulted in the infamous "bugsplat".

      I'm at my wit's end here... any ideas?

      Thanks,
      Jeff
      PS: My Ruby install gives RUBY_PLATFORM=i386-mswin32_100, RUBY_VERSION=1.8.6; Sketchup gives RUBY_PLATFORM=i386-mswin32 and the same version

      posted in Developers' Forum
      J
      jefftrull