Hello. I want that when the user selects a scene, the current scene is updated and the camera position is saved.
In SU2022, the method worked
class MyViewObserver < Sketchup::ViewObserver
def onViewChanged(view)
if Sketchup.active_model.pages.size>0
if Sketchup.active_model.pages.selected_page.name=="View"
Sketchup.active_model.pages.selected_page.update(PAGE_USE_ALL)
end
end
end
end
Sketchup.active_model.active_view.add_observer(MyViewObserver.new)
It doesn’t work properly in versions 23 and 24. The “View” scene is overwritten by the selected scene.
I try frameChange && onContentsModified(pages), but I’ve failed everywhere. Do you have any ideas?