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
onContentModified
sets 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
Advertisement