Layout ruby to export to images

Is there a way to do “File > Export > Images” with the ruby api?

I checked the api but don’t seem to find it.

I don’t think so. When PDF exports have been discussed in the past the answer has been to manually rebuild it using a PDF library and exploding viewports to get out the images and lines.

use view.write_image

options = {
  :filename => "c:/tmp/write_image.png",
  :width => 640,
  :height => 480,
  :antialias => false,
  :compression => 0.9,
  :transparent => true
model = Sketchup.active_model
view = model.active_view

Shoot, I missed the layout tag.
You can write to image in layout as well:
(give me a second)

… but not from ruby it seems :slight_smile:
You can however export images using the c sdk

result = LODocumentExportToImageSet(document,


Thanks for the answers.

I knew it is possible with the c sdk option, but for now I just manage to do the ruby solutions…
When i have the time, i will have to look for some getting started thing i guess.

Let me know if you need help with that.