Most of cases doing an integer comparison is enough.
In regards the EntitiesBuilder your code will be okay, since it is released at major version.
Another pattern could use Ruby’s introspection …
if defined?(Sketchup::EntitiesBuilder)
# new
else
# old
end
When I can talk about what I am looking for, I can stay in the creative moment.
Learning code might be fun for a code generating type, and that’s great, but when in the middle of building an object, chatGPT allows for that moment.
In fact working with chatGPT can help you to understand what you are trying to achieve. Copy and paste the code and the creative process is not interrupted.
I have a different experience with ChatGPT. It often gives you code that is nearly correct. I have been coding 40+ years and sometimes errors can be corrected quickly but for a creative type who does not like coding that can be different.
@Elmtec-Adam started about ChatGPT a few messages above, I don’t know why he got the impression that the code above was generated but someone without experience might run into a pitfall.
Ah, it was because they code you were given was from chatGPT
The code I provided above was generated by ChatGPT and edited by me to suit the subtleties of SketchUp. The original code had errors. Сhatgpt saves a lot of time