Example of Compiled Extension with SWIG and CMake
-
This sounds interesting.
@unknownuser said:
A great idea floated around at Basecamp was to wrap the C++ SDK for file access with Ruby, that way developers could write Ruby scripts to access skp files from within SketchUp or at the command line.
That is very interesting!
-
-
I started a project to wrap the SDK for Ruby at:
http://code.google.com/p/ruby-sketchup-sdk/
I am just getting started now and focusing only on Windows but hopefully this could be extended pretty quickly. Let me know if you are interested in helping/using.
Dan
-
Hey Dan, it was great to meet you at Basecamp. I do think this is an interesting project. I'm of no use in helping out with project, but I am interested in using it
Chris
-
I'm also interested in this project - though atm mostly of curiosity without any exact specific usage, yes.
-
@thomthom said:
I'm also interested in this project - though atm mostly of curiosity without any exact specific usage, yes.
I think you could, for example, write a .skp converter using ruby that worked on a .skp file instead of needing to run in SketchUp.
Batch conversions, thumbnail extraction, add/remove/modify geometry, explode, etc.
-
I imagine AdamB said at some point he'd managed to access setter methods for layers and materials via the SDK. Even get layer materials. Now that would be useful!
-
After working with the SDK for a little while I don't think it can be wrapped as quickly as I first thought. I have to get back to work on my real tasks so the SDK wrap project will have to wait for a while. But I did make another example using SWIG with directors to show how to pass Ruby objects into C++ code. We are looking into this to implement Ruby observers for events that happen in our own C++ code.
Hope this helps,
Dan
-
(you can upload .zip files here)
-
Hi, has anyone tried this on Mac OSX (10.6)?
For SWIG I did the standard: ./configure, make, make install.
but when i try to CMake your examples above i get this:swig error : Unrecognized option -initname
swig error : Unrecognized option Examplefor -initname "Example" in CMakeList.txt
also if i remove that it doesn't get better.
I tried SWIG versions 2.0.0 and 1.3.40 with no luck,
and I have ruby 1.8.7 (so should be no problems here...).Please help,
Thank you.
Advertisement