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...
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...
When you need to create complex geometry in SketchUp, it is often better to break an item into positive (solid) parts and negative (void) parts that you can then subtract from each other with SketchUp's Pro's Solid Tools. In this example, I am showing this process for a cast steel structural connector, but the principle applies to many other shapes as well.
Because this process uses solid geometry from beginning to end, the result is also a solid and therefore easily 3D printable.
Side view
My model doesn't replicate the geometry of this piece exactly, but this is an example of such geometry
Tutorial Video
https://www.youtube.com/watch?v=jrhfJjT8YBQ
Links
Some of the tools I used here are:
SketchUp's built-in tools:
Solid Tools (specifically the Subtract tool)
Parallel-projection camera view
Hide / show
FredoCorner Extension - One of Fredo6's excellent extensions that allows you to round corners...
In this video I am having a bit of fun with the new SketchUp Diffusion tool…
Give this a try: Add only a single cube to your modeling space and then try to create an interesting visualization from that using only the prompts and the styles in SketchUp Diffusion. This is actually a great way to explore prompt engineering. It is interesting how the AI is able to capture the general orientation of the scene from just the cube and the horizon line behind it.
You can find my original forum post about this on the SketchUp forums here. And admittedly I based this on a competition that the Blender community has been doing for a while. Check those out, too.
For more on what you can do with SketchUp and Diffusion, take a look at my initial post about this topic.
Video
https://youtu.be/dQmV58Jlq4c
Examples
Here are some of my own examples:
Prompt: "A treasure in a luxurious space."
Prompt: “A floating, death star spacecraft over a...
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....