OnPageChange event
-
I wanted to detect a Scene change in SketchUp. The only method I could find was onContentsModified of the PagesObserver, which apparently gets fired twice.
I know it could be worked-around using a timer.
I just can't stop asking myself "Where's the onPageChange" event?
-
And in Google SketchUp Ruby API what's the difference between
PagesObserver.onContentsModified
and
PagesObserver.onElementAdded
If I add a scene am I not modifying the pages content?
There is no pageObserver. So if I update a page am I modifying the pages content?
I know if I change the selected_page, PagesObserver.onContentsModified tells me which page, but I am not really modifying the content aren't I just getting data at that stage?
I think we should be told!
-
def CgScenes.page_contents_modified(pages) a = 0 #puts(pages) pages.each do | page | if page == pages.selected_page @ind = a puts "Modified " + pages[a].name.to_s end a = a + 1 end array = [0,@ind] #colNo,activeRow array = array.join(",") @dlg.execute_script("sceneSliderAdjust('#{array}');") end
One for the old; one for the new!
-
@chrisglasier said:
And in Google SketchUp Ruby API what's the difference between
PagesObserver.onContentsModified
and
PagesObserver.onElementAdded
...
Now I have got to the point where I am checking what happens when the scene machine is plugged in to a model with no scenes. It is sensible to add one or more scenes to get started. But when I do that
onContentModifiedsets off the JavaScript function for a scene selected from an existing set and throws an error. I suppose I will find a way round, but it does not seem right when there is "onElementAdded." There again I could have missed something fundamental. Either way I would appreciate some clarification.Thanks
Chris
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement