- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I know there has been many discussions about DocumentChanged eventhandler and Dynamic Model Updater. This is another observation and I thought it would be useful to share:
I want to keep track of changes made to AssemblyInstances and save the changes to an external database - no internal changes - so I am registering a handler to DocumentChanged event and I am not working with Dynamic Model Updater. The advantage is it is raised with Undo and Redo too.
Everything works fine except when the user enters the Edit Assembly mode. In that mode, making the changes raises the handler and again everything goes as expected but when the user cancels and exit the edit assembly mode,event handler is raised but GetModifiedElementIds(), GetDeletedElementIds() and GetAddedElementIds() does not reflect any ElementIds.
As the workaround, I am tracking the transactions too by using GetTransactionNames(). I am retrieving all changes during 'Assembly Edit' transaction but save them to the external database only after making sure the edit was not cancelled by the user.
Solved! Go to Solution.