The event OnViewUpdate in the drawing view events seems to never fire. Subscribing to the event doesn't through any errors.
Does the event need to be enabled? If this event doesn't work is there another event the can notify of drawing updates?
Solved! Go to Solution.
Solved by adam.nagy. Go to Solution.
Solved by adam.nagy. Go to Solution.
Hi Rodney,
The easiest way to see which event fires when is to track all the events in this sample from the SDK:
C:\Users\Public\Documents\Autodesk\Inventor 2014\SDK\DeveloperTools\Tools\EventWatcher
Cheers,
Thanks Adam, using the Event Watcher I could see that the event was firing.
After examining the event watcher code I determined it had to do with the how I was handling the DrawingViewObjects I was attaching the events to. For some reason (that I can't figure out) it seems as if a DrawingViewEvents object variable must be referenced from an object at global scope or a scope that is always persistant in order for the OnViewUpdate event to fire.
Along with the OnViewUpdate, is there a way to determine what drawing view the event has fired for? I want to examine and update certain Dimensions but only after the DrawingView they are attached to has updated.
Thanks
Hi Rodney,
First I thought you just missed the fact that these events are DrawingView specific, but then realized that even knowing that does not make the answer straight forward, so I had to think about it 🙂
Here is what I came up with:
http://adndevblog.typepad.com/manufacturing/2014/10/which-drawingview-triggered-onviewupdate.html
And concerning declaring the variables globally.
That is as designed. If a variable goes out of scope then it will be destroyed and so cannot handle events:
http://msdn.microsoft.com/en-us/library/hks5e2k6.aspx
Cheers,