Page.update problem on change scene SU23\24

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?

1 Like

The reasons have been found why everything works fine for me in 2022, but not at 23 and 24. When Trimble Scan Essentials is active, my code stops working correctly.
I found the following solution:

def onViewChanged(view)
	UI.start_timer(0.5, false) { 
	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
2 Likes

What version of Scan Essentials ? Is it the lates available ?

Version 1.2024.0318 is the current version in the Extension Warehouse.

I try reinstall Trimble Scan Essentials, from Extension Warehouse.Its last version.