Beginner's SketchUp API workflow

It would be great to get feedback on where you find yourself stomped. For us writing this it’s easy to become blind to the challenges of getting into a new topic. We have a lot of resources on our GitHub repository, the first thing I’d recommend is setting up a GitHub account and use the Issue Trackers in the various repos. We’d love to work with you in improving the guides and tools.

One attempt is this repository:

You’ll see that it have two main folders, examples and tutorials. The tutorials are heavily commented, explaining every single line. At the moment there are two, one showing the absolute minimum for an extension (with the file structure needed for Extension Warehouse) and the other introduces Ruby tools.

The Examples folder has more, but is not as heavily commented. It’s more aimed at showing various common concepts.

We have this VSCode github template, GitHub - SketchUp/sketchup-extension-vscode-project: VSCode Project for SketchUp Extension Development. You can choose to Use This Template to create a new repository, in which you will have complete base setup for writing SketchUp extensions using VSCode with code insight and debugger configurated. However, it’s not 100% plug-and-play if you’ve never used it before, it does require having Ruby installed on your machine. There is a lot of room for improvements to the README etc. Log an issue in the tracker and we’ll try to fill in the blanks.

Yes, in large part we do assume existing Ruby/programming experience. Teaching the basics of programming in a challenge of its own. For those who have never touched programming I tend to recommend they start with the official learning resources of that language. Ruby has it’s own “Getting Started” section where you can play around in the browser. Also a “Ruby in Twenty Minutes”.

Andreas’ Console+ is also a nice tool to get started, recently he added tutorials to it: Extension | SketchUp Extension Warehouse

During the first virtual dev meetup yesterday it was suggested that we cover topics such as the debugger, TestUp etc. It’s something we’ve done at DevCamps before, and doing so to a wider audience would be nice. It also got me wondering if it might be any interest in us doing videos/screencasts of our setups?

Personally I use VSCode a lot, but I also have RubyMine. Both have their strengths. For my extension projects I either use that VSCode github template or my custom tool skippy (GitHub - thomthom/skippy: CLI Development tool for SketchUp extensions) to quick-start the boiler-plate.

Using the debugger (GitHub - SketchUp/sketchup-ruby-debugger: Ruby API debugger for SketchUp 2014 and later.) is one of the most valuable tools I can recommend getting familiar. Being able to step through code and inspect variables instead of edit/puts/reload/repeat is such a nicer experience.

TestUp is also a key tool in delivering stable products. I got to admit that I haven’t leveraged it much for my small free extensions. But certainly in my commercial ones they are critical to avoid regressions.

Another advanced tool, that I don’t have the need for in most of my extensions, but when performance becomes critical it’s alpha and omega to be able to profile your code and really understand where the bottlenecks are. (GitHub - SketchUp/speedup: Profiling tool for SketchUp Ruby extensions.)

All of this I’d love to make more accessible. Lowering the bar for more people to get started with extensions, and providing paths to rapidly deliver extensions of high quality.

If you would care to provide us with feedback on where you are stuck we’ll work with you. Best thing is to file specific issues in the various projects’s github repos. Makes it a lot easier for us to respond faster with concrete solutions/improvements.

If it’s about general concepts where you’ve not found relevant tool/example on github, start a thread here and we’ll talk.

5 Likes