Scene with ruby

I have a Sketchup model with several scenes,
I am writing a ruby script and I want it runs in all the scenes (a scene after the other) for the moment I only runs in the “active scene” (selected_page) do you have an idea ?

Thank’s for your help

In the Ruby API, scenes are called “Pages”. You access them via Sketchup.active_model.pages. Use Pages#each to iterate through the pages or Pages#selected_page= to activate one.

Thank you for your reply,
But I still do not get to do what I want.
My script runs as many times as I have pages, but he recovered every time properties (name in my case) of selected pages which is selected no other :

My script is :
model = Sketchup.active_model
pages = model.pages

I do my operations then I finish by }

I tried to replace the “selected_page” by “current_page”, “active_page” and many other things but it doesn’t work

Do you have an idea ?

Thank’s for your help

Do not re-use the variable |pages| inside the loop, use |page|

logical !!
thank you very much jim

To clarify further…


the above ‘page’ is a reference to the page in the array of pages
whereas ‘selected_page’ is the current active-scene-tab…

1 Like