Generate report from Ruby API


There is a “Generate Report” functionality in SketchUp. Is there any way to do this from Ruby API? I do not want to open that window, etc, just click on a button which generates the report file automatically. Could you provide an example code for this please? Thank you.

There is no dedicated API class (that I know of) to manipulate and run reports as this feature is a web-based platform. (The user must be connected to the internet to see the newest version of the interface with custom report builder. Otherwise the old local interface with hard set report options is shown.)

The reason they switched to web-based is so that they can update and improve it at anytime independent from the application’s update cycle.

You can open a feature request in the official API tracker:

But I don’t think it would be anything more than firing off a predesigned report.

A more complex report API might stifle innovation in the generator and it’s interface.

There is no send action to open the window anyway. (We cannot use send_action to send a command ID, because SketchUp assigns a command ID “on the fly” as it loads, so this ID can be different each time depending upon what other commands get loaded.)

A shortcut would need to be assigned to the menu command and then a key sender used to bring up the window.

Not specifically the native SketchUp “Generate Report” feature, but creating text files and reports is one of the basic features of the core Ruby programming language.

There are numerous topic threads here about “walking” the model hierarchy and collecting information for export. (A text report written to a file is he simplest form of export.)

Thank you for your answer! Actually I need the dimension and the color of each component in the model saved to a CSV file.
So I guess I should find the components somehow in the model and get their properties. Can you send the link of a thread where I can find information about how to “walk” the model hierarchy?
I found this one: Getting a list of Component from current collection
but I don’t think this is what I need…
Thank you!

Sorry I’m busy for awhile. There are quite a few I’m sure. Learn to use the forum’s search feature and advanced search form.