I have been writing a ruby script that creates a specific geometric shape based on several input parameters. I would like to be able to export the resulting model as a .stl file as part of my script, but I am unsure of how to do this. I have downloaded and installed the Sketchup STL plugin, and I have used it many times through the GUI. Is there a way to use it through the Ruby API?
In older versions of SketchUp, the STL Ruby extension was an optional installation that only some users had installed or activated. You could use the Ruby console to inspect which constants and methods the extension creates or check its source code on Github. Note that like in all software, methods that are not documented as public API may be changed at any time and are not supposed to be used from outside.
Thank you! I’ve looked into both options. The second option unfortunately won’t work for me because I am using Sketchup Make 2017, which will never be updated. I tried out Sketchup Free, which has STL export as a native plugin. However, Sketchup Free does not seem to have a ruby console, so I can’t use it for my project.
I’m a little unsure how to proceed with the first option you laid out. I’m very new to ruby (just started learning several weeks ago), and I have never used github before. I tried looking at the source code for the file “exporter.rb,” but I am unsure of what constants/methods to look for and how to use them. Do you have any suggestions?
My apologies if I come across as rather ignorant. Have to start somewhere.