How to get Scene/Page preview from Ruby API?


Is there a way to retrieve or compute the preview to image file for all scene/page of the current model ?

Capture d’écran 2022-02-27 à 08.49.46


I don’t think page thumbnails are available in the Ruby API directly.

My ideas:

  • Go and iterate through the pages and after make it selected use the View #write_image method to write the current view to an image file with a desired “quality”.
    ( Before iteration ‘backup’ Sketchup.active_model.options ["Page Options"] ["Show Transition"], set to false and then restore after iteration…)

  • The current .skp files (since SU2020 ??) is actually a zip files. Where there is a folder scene_thumbnails for storing this small images. You can probably get out of this. (I have no experience with that…)

1 Like

Thanks for this tips, @dezmo !
I will look at that.

There’s currently no API access to these thumbnails. Log a feature request if you like: Issues · SketchUp/api-issue-tracker · GitHub

Ok, thanks !