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…
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.