Now You Can Have an AI ‘Copilot’ (Assistant) for Ruby Coding in SketchUp

Now You Can Have an AI ‘Copilot’ (Assistant) for Ruby Coding in SketchUp

In this tutorial I cover one specific use case for my OpenAI Explorer SketchUp extension: A coding 'copilot' (assistant) for Ruby code. This is one of several use cases for this extension and it has the potential to at least save you from a ton of web browsing. When I write SketchUp Ruby code, I frequently need to look up code snippets. With the approach presented here, I can use AI to provide such snippets for me instead. This works well with my Ruby Code Editor extension where you can then past, edit, and run that code. But it will also work with the built-in Ruby Console. Tutorial Video https://www.youtube.com/watch?v=GwhD5reOkoo Links OpenAI Explorer SketchUp extension Ruby Code Editor extension ...
Read More
Adding AI Vision to SketchUp with OpenAI’s gpt-4o Model (Ruby Snippet)

Adding AI Vision to SketchUp with OpenAI’s gpt-4o Model (Ruby Snippet)

Response to the prompt: "Is there anything wrong with this building?" Earlier this week, OpenAI released its new gpt-4o model. This model not only improves and updates its current AI models, but it also adds vision ability. As a result, a user can upload images and then the AI can identify things in the image based on a user prompt. There are some great examples of the new capability on OpenAI's website. Since I previously implemented the OpenAI connection with SketchUp using both plain Ruby code and a handy extension, I had to try out whether we can connect the two using these new capabilities, too. One use case for this could then be the ability to ask questions like "What may be missing in my model?" or "Is there a cat in the model?" (Not sure why you would ask the latter but it leads to a correct answer!) As it turns out, giving SketchUp this AI capability is not too hard...
Read More
Save a SketchUp File as an Older Version (Ruby Snippet)

Save a SketchUp File as an Older Version (Ruby Snippet)

With the recent introduction of SketchUp 2024 came one change in functionality that has the community talking here and here. In 2023, when you went to the File > Save As... dialog, you had all of the SketchUp versions available all the way back to version 3 (Why not version 2? That's when I got into SketchUp!) as a file format option (see image below). With 2024, this has now gone away and files can "only" be saved in the version-less SketchUp file format that was introduced with SketchUp 2022. SketchUp Desktop 2023 SketchUp Desktop 2024 In principle, the version-less format (which, by the way, has with the 2024 version also been introduced for LayOut) is a very convenient thing: You can open a newer file in an older version (albeit with a warning that some functionality may be lost). That makes working in computer labs (which are notoriously slow to update) and other environments much easier. It is also VERY MUCH better...
Read More
Coding Your First SketchUp Extension

Coding Your First SketchUp Extension

In this (beginner!) video tutorial I give a very basic overview of the process needed to create a SketchUp extension from scratch and then distributing it as an RBZ file. Admittedly, this isn't completely from scratch since I am starting with a template file that you can simply download from this site, but the result is a very basic yet fully-functional SketchUp extension. Want to learn more about Ruby scripting? This video does not cover much of Ruby scripting, but you can read up on that topic in Chapter 7 of my book. Tutorial Video https://youtu.be/fDV92tkzTh0 Links Extension template files - You can download those from my website here. SketchUp Ruby API - SketchUp's official API reference. ...
Read More
Make your life easy: Load SketchUp extensions from a cloud folder with a small Ruby script

Make your life easy: Load SketchUp extensions from a cloud folder with a small Ruby script

Are you using SketchUp Pro on multiple computers? As I mention in Chapter 2, it may make sense to leverage one of the many cloud storage services (that you may already be using) like Dropbox, OneDrive, GDrive, etc. to make your life easier by synchronizing those. In essence, using the approach presented here, you can off-load extensions that you want to have available on both machines onto a shared drive, and then you load them back from the respective computers using the script shown below. Tutorial Video https://www.youtube.com/watch?v=mI6FvENlIno Tutorial Steps Step 1: Designate a folder on your cloud drive First, designate a folder on your cloud-synchronized drive as the Plugins folder. As you can see in my example below, I am using OneDrive (at C:/Users/<username>/OneDrive/SketchUp/Plugins), but you can use any other service, too (e.g. for Dropbox on Windows it would likely be C:/Users/<username>/Dropbox/). Of course, for this to work you need to have a cloud-synchronized local folder, not just an online folder. And that folder...
Read More