Getting Started with C++ and Sketchup
-
Hi, I'm a new user and I'd like to get started with the programming aspect of Sketchup. I'd just like to ask you all how to get started with the C++. I downloaded the package on the SDK kit, but now, what's the next step?
I'd prefer to use C++ since that's the language I'm most familiar with, but if necessary I'll use Ruby. The
When I go to the stuff downloaded from the SDK page, there's a folder with "Binaries" "Documentation" "Example" "Interfaces". So, where do I go from here? Any help would be appreciated.
-
The SDK you downloaded is mostly for 3rd Party applications to enable reading and writing SKP format files.
The language for scripting inside Sketchup is Ruby. So you need to learn Standard Ruby. Sketchup loads Ruby extensions (modules called the Sketchup API, and some additions to standard Ruby classes.)
There is no way for you to avoid learning Ruby.
However.. Ruby itself is written in C. Once you know how Ruby works, you can write plugins for Sketchup in C or C++ and wrap them to expose them to Ruby. (There are tools like SWIG that make this easier.) These kind of plugins are complied into a SO or DLL files. Many of the standard extented Ruby libraries are distro'd as compiled .so files. The global Ruby method require() can load text scripts (.rb) and also compiled binaries (.so,.o,.dll,.dylib, etc)
Click the link in my signature line.. it will lead you to a bunch of information, downloadable books, etc.
You can also search this forum.. as we've discussed writing plugins in C and C++ in the past. -
Thanks.
Now I know where to start.
Advertisement