# Observer for "Update Scene"?

**URL:** <https://forums.sketchup.com/t/observer-for-update-scene/4985>\
**Category:** Ruby API\
**Created:** [December 16, 2014, 9:56pm UTC](https://forums.sketchup.com/t/observer-for-update-scene/4985 "2014-12-16T21:56:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![simoneves](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@simoneves](https://forums.sketchup.com/u/simoneves)\
**Post date:** [December 16, 2014, 9:56pm UTC](https://forums.sketchup.com/t/observer-for-update-scene/4985/1 "2014-12-16T21:56:58Z")

</div>

Is there a way to register interest in a Scene (Page) being explicitly updated?

I know there are observers for adding and removing Scenes (aka Pages) but I need to know when to update data of my own that I am saving in an AttributeDictionary on the Scene (Page).

Since Page is a subclass of Entity, I tried attaching an EntityObserver to each Page, but it doesn’t seem to get called.

---

<div class="post-metadata">

**Author:** ![DanRathbun](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/danrathbun/32/500_2.png) [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Post date:** [December 17, 2014, 12:15am UTC](https://forums.sketchup.com/t/observer-for-update-scene/4985/2 "2014-12-17T00:15:34Z")

</div>

Yes it is a known issue.  
Ref topic at SCF: [Detect update scene • sketchUcation • 1](http://sketchucation.com/forums/viewtopic.php?f=180&t=54473)

I filed an API Feature Request for this last year.  
It was logged internally by Chris Fullmer.

It read like this:

> [@Dan Rathbun](#):
>
> **[Ruby] Page Update observer callbacks**
> 
> Implement scene page update callbacks, either for existing **`PagesObserver`** , [or create new **`PageObserver`** for observing single page object(s).]
> 
> - I’d think it easier and more robust to have the former, rather than the latter.
> 
> Two callbacks would be beneficial:
> 
> **`onBeforeUpdate( pages, page )`**  
> Called immediately before the page argument is updated.
> 
> **`onAfterUpdate( pages, page )`**  
> Called immediately after the page argument is updated.
> 
> ref topic at SCF:  
> [Detect update scene • sketchUcation • 1](http://sketchucation.com/forums/viewtopic.php?f=180&t=54473)

---

<div class="post-metadata">

**Author:** ![DanRathbun](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/danrathbun/32/500_2.png) [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Post date:** [December 17, 2014, 12:31am UTC](https://forums.sketchup.com/t/observer-for-update-scene/4985/3 "2014-12-17T00:31:24Z")

</div>

> [@simoneves](#):
>
> Is there a way to register interest in a Scene (Page) being explicitly updated?

Here in the new forums, the place will be:  
[http://forums.sketchup.com/c/developers/feature-requests](http://forums.sketchup.com/c/developers/feature-requests)

---

<div class="post-metadata">

**Author:** ![simoneves](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@simoneves](https://forums.sketchup.com/u/simoneves)\
**Post date:** [December 18, 2014, 5:49pm UTC](https://forums.sketchup.com/t/observer-for-update-scene/4985/4 "2014-12-18T17:49:33Z")

</div>

Thanks, Dan. Looks like I reached the same conclusions as found in that other thread. Oh well.

---

<div class="post-metadata">

**Author:** ![Finfa811](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/finfa811/32/28617_2.png) [@Finfa811](https://forums.sketchup.com/u/Finfa811)\
**Post date:** [October 10, 2018, 8:24pm UTC](https://forums.sketchup.com/t/observer-for-update-scene/4985/5 "2018-10-10T20:24:03Z")

</div>

I recently ran into an issue whose best solution would be having a Page Update observer. Those `onBeforeUpdate` and `onAfterUpdate` callbacks would be nice to have. So far I’m using another tricky solution but it’s not the ideal way to do it.

You said you requested the feature almost 4 years ago, but I can’t find track of the request.  
Just asking if there have been any news since then, in order to create a new request in case it has been ignored.

---

<div class="post-metadata">

**Author:** ![DanRathbun](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/danrathbun/32/500_2.png) [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Post date:** [October 11, 2018, 10:39am UTC](https://forums.sketchup.com/t/observer-for-update-scene/4985/6 "2018-10-11T10:39:24Z")

</div>

> [@Finfa811](#):
>
> You said you requested the feature almost 4 years ago, …

It was actually 5 years ago this month.

> [@Finfa811](#):
>
> … but I can’t find track of the request.

Back then, the requests had to be made in a private manner. As I said it was logged by Chris in Trimble’s **internal** database. The public does not have direct access to this **internal** database. (But they will often mention the internal tracking number.)

> [@Finfa811](#):
>
> Just asking if there has been any news since then, in order to create a new request in case it has been ignored.

No recent news. They never give **_public_** news of upcoming changes or new features due to the competitive nature of the software industry.

“Ignore” is not really the correct word. It is logged but just has not percolated to the top of the priority list. There are MANY feature requests for nifty API improvements that I’ve logged over the past 10 years or so that have not been implemented for various reasons.

- One of the reasons that many observer requests were put off was because they were planning an overhaul of the observer system. That overhaul was eventually done in the summer of 2015 for the SketchUp 2016 release. But since then there have been many other long needed improvements made and some very major updates such as the Ruby version used, the LayOut API and the C API parity project, that have had priority.

Feel free to call attention to the “_squeaky wheel_” by entering a fresh new request in the public issue tracker. Perhaps it will get some “_grease_” soon …

> **[Issues · SketchUp/api-issue-tracker](https://github.com/SketchUp/api-issue-tracker/issues)**
>
> Public issue tracker for the SketchUp and LayOut's APIs - Issues · SketchUp/api-issue-tracker

You can also add in any new nifty ideas you may have to the request, or add other callback ideas for the [**`Sketchup::Page`**](http://ruby.sketchup.com/Sketchup/Page.html) class or [**`Sketchup::Pages`**](http://ruby.sketchup.com/Sketchup/Pages.html) collection.

Generally, the SketchUp Extensibility Team will “save up” bug and feature requests for classes and implement them in one cycle. (_Economy of scope_ especially with regard to the testing cycle, etc.)

I’m not sure if it made it into the original request, but at one point I had at least discussed (somewhere) that it might be beneficial to pass the update properties to the callback, both previous and what the integer argument was for the current update call. Ie, see [`Sketchup::Page#update()`](http://ruby.sketchup.com/Sketchup/Page.html#update-instance_method) documentation. That way the observer callback could respond to specifics of how the page was being updated.
