PagesObserver

Why is the following…

module PaulMcAlenan	
	module Test

	extend self

	class MyPagesObserver < Sketchup::PagesObserver

		def onContentsModified(pages)
			pagename = pages.selected_page.name
			puts pagename
		end
		
	end

Sketchup.active_model.pages.add_observer(MyPagesObserver.new)

	end
end

displaying multiple puts in the console when change the scene…

Screenshot 2022-06-09 192341

This was previously discussed and Thomas summed it up in this API tracker issue …

… which is an echo of the forum post:

1 Like

If it is only the change to a new scene page you wish to watch, you could consider implementing a FrameChangeObserver and ignoring all the frames in between 0 (0.0) and 100 (1.0) percent.