Need to save each scene separately as .SKP file

Hi All

I am looking for a way to save each scene as separate SKP files.

Please help me to solve this problem with the help of ruby.

Thanks in advance.

Untested, but maybe something like this?

model = Sketchup.active_model
path = File.dirname(model.path)
model.pages.each_with_index { |page|
  model.pages.selected_page = page
  filename = File.join(path, "#{model.title} - #{page.name}.skp")
  model.save_copy(filename)
}
1 Like

Yes, but then would each one of the scene files need to have all the other scene pages purged ?

Ah… yea - I didn’t think of that. hm… would probably have to make a temporary operation before save_copy that removes all non-visible geometry and purge the model. Then undo that after save (can’t have an open operation during save I think