Is there any event on view table change?

@dale i wonder if there is any way to know that document views and named views has changed? I haven’t seen any option in api maybe some tip/workaround on this?

Hi @D-W,

The two are very different ‘things’. But I don’t believe there are change events for either. A changed event on a document view could really adversely effect performance.

Why is know this important?

– Dale

Well i have combo where user pick desired view for frustum clipping so it would be good to know if change happened cause i could refresh that clipping for eg. user picked SomeNamedView and then user overwritten this view with new one so i could update my viewport info about (picked in combo as old but resaved as new in named views) viewport - and for viewTable i thought rather if there are added new or removed old ones for namedViewsTable this could be more advanced.

@dale ok if not that is there any possibility of setting current view? I can hook to SetActive event but how i can set it via code? or is there event that view has changed i mean for eg certain view was restored or sth?

Does this help

And regarding tracking of views I think you are best of creating a conduit from which you emit your custom events when a view has changed etc.

Unfortunately this way i can only quick swap a to b and back to use SetActive event down side is when there is one view only even if i set this to the same vp since vp didnt changed event isnt fired.

Could you elaborate your idea about custom conduit to track named view table changes?

Something building on https://developer.rhino3d.com/guides/cpp/tracking-camera-changes-with-conduits/ - I was thinking you wanted to know when a viewport changes in a view. But maybe that doesn’t work for your case.

I need to know when named view table changes and when named view is updated and when current view window has changed and if current viewport has changed - dont need camera position change here probably only aspect ratio would be ok.

@jesterking thanks for link but im not sure if this is possible with rhinocommon.

@dale i would like to ask if using rhino idle event is highly not recomended? But im not sure here what means idle - is that true when rhino does exacly nothing even not panning etc. That will suit my needs cause so far i dont see better place to hook to stay in sync with named view table.

Hi @D-W,

An Idle event is triggered when Rhino becomes idle - Rhino is not doing anything (like running a command) and the Windows message queue is empty. Doing stuff in an OnIdle handler is already recommended.

When something happens to a named view, a RhinoDoc.DocumentPropertiesChanged event should be raised.

– Dale

Thanks @dale for info about document properties event but im not sure why it is raised twice there (on idle works fine it is fired once) im comparing if new viewportinfo camera position or direction is different than previous and it returns on one namedview action that condition is met twice. I think if on idle is ok ill stick to the idle event here.

@dale sorry my fault i didn’t updated collections of views on first call now everything is ok :ok_hand: :blush: