Observer for "Update Scene"?

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.

1 Like

Yes it is a known issue.
Ref topic at SCF: Detect update scene • sketchUcation • 1

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

It read like this:

1 Like

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

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

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.

It was actually 5 years ago this month.

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

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 …

You can also add in any new nifty ideas you may have to the request, or add other callback ideas for the Sketchup::Page class or Sketchup::Pages 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() documentation. That way the observer callback could respond to specifics of how the page was being updated.

1 Like