TheSwamp

Code Red => .NET => Topic started by: JohnSnow on July 25, 2023, 09:17:41 PM

Title: Is there any event for the changes of view (viewport)
Post by: JohnSnow on July 25, 2023, 09:17:41 PM
Hi,

I am wondering if there is any event for monitoring the view changes? Like if I rotate or zoom the view (in a 3d space) this event will be triggered?
If no, is there any workaround? I have tried "Regen" with no luck so far.
Much appreciated.
Title: Re: Is there any event for the changes of view (viewport)
Post by: gile on July 26, 2023, 12:46:40 AM
Hi,

Document.ViewChanged (https://help.autodesk.com/view/OARX/2023/ENU/?guid=OARX-ManagedRefGuide-Autodesk_AutoCAD_ApplicationServices_Document_ViewChanged)?
Title: Re: Is there any event for the changes of view (viewport)
Post by: JohnSnow on July 26, 2023, 08:15:30 PM
Thank you very much. I have been looking for it in Editor.
Title: Re: Is there any event for the changes of view (viewport)
Post by: BlackBox on July 27, 2023, 12:34:24 PM
While Gile's Inspector app is superior to Autodesk's MgdDbg for digging into objects, MgdDbg does provide an Events menu item that might be useful for things like this.

Perhaps Gile already has an Inspector update that does this; if so, I've missed it. :beer:

Enable the Events you want (or think you need, if not all)... then simply do the things you're trying to understand manually (change View in this case)... when done, turn off Events and look through the Command Line history to see what Events are actually being raised.
Title: Re: Is there any event for the changes of view (viewport)
Post by: JohnSnow on July 28, 2023, 12:54:23 AM
Thank you. That's helpful
Title: Re: Is there any event for the changes of view (viewport)
Post by: JohnSnow on July 30, 2023, 10:43:50 PM
That Document.ViewChanged is working fine.
Just a quick note (it doesn't really bother me much tbh): This event is not triggered until I stop holding the mouse wheel while trying to rotate or pan the view. Any workaround to "fix" this or I should try timer?