How to Get All Changed Elements, Including Unsaved Changes, Using Document.GetChangedElements()?

felixK4ZSQ
Observer

How to Get All Changed Elements, Including Unsaved Changes, Using Document.GetChangedElements()?

felixK4ZSQ
Observer
Observer

Hi everyone,

I'm currently using Document.GetChangedElements(baseVersionId) to retrieve all elements that have changed since an earlier version of the document. This works well for identifying changes where Revit has created a new version ID.

However, I've noticed that when changes are made without Revit generating a new version ID, those modifications are not included in the results of GetChangedElements().

Is there a way to retrieve all element_ids that have changed since the last version, including those unsaved changes? Or is there a way to use GetChangedElements() so that it captures all changes, even if they don’t correspond to a new version ID?

I came across this question  where @jeremy_tammik provided insight on obtaining document changes compared to an earlier version. I was wondering if there’s a similar or complementary approach to handle this scenario without saved changes.

Thanks for your help!


Helpful links:

API: Document.GetChangedElements(): https://www.revitapidocs.com/2024/0799eb9e-5ce8-2668-eb3d-aecfd121b2d6.htm

0 Likes
Reply
156 Views
1 Reply
Reply (1)

jeremy_tammik
Autodesk
Autodesk

Interesting question. I have not used the GetChangedElements method myself. My main experimentation in this direction is captured in the TrackChanges project:

   

   

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open