We often find that we need a level of training that goes well beyond the basics, but is more informative than just reading the API documentation. Look no further! Check out our Example Extensions section for examples of fully functioning SketchUp Extensions, complete with comments and helpful hints.
Hopefully you can use these examples however you want. The Example code is available 3 different ways. You can:
Depending what you are trying to achieve, there is a method to get there easily. Just get all the code at once, and pull out what you need. Or follow along line by line, tutorial style. The end goal is for everyone to gain access to solid code examples that help improve their SketchUp extensions.
If you clone this repository to your computer you can load the files directly from where you cloned them using a proxy loading script:
# Create a file in your Plugins folder with these lines:
$LOAD_PATH << 'some\path\to\sketchup-ruby-api-tutorials'
require 'load_tutorials.rb'
That snippet will take care of loading the examples and tutorials.
If you have examples of your own that you think might be useful open a Pull Request. Follow the pattern of the existing examples.
You can use Examples.reload
while you work to reload all the files.
Also make sure to check out the Wiki section for guides on how to setup your project for extension development, IDE setup and more.