I have a problem working with a central file model and two local files on two different machines. When I add an element on one machine, do a sync and then reload on the other machine, the API does not see this newly added element with the DocumentChanged event.
This is the code:
private void DocumentChanged(object sender, Autodesk.Revit.DB.Events.DocumentChangedEventArgs e)
{
switch(e.Operation.ToString())
{
case "TransactionUndone":
case "TransactionRedone":
case "TransactionCommitted":
this.transactionEventHandler.HandleEvent(sender, e, this.persistance, this.elementMutationHandler);
break;
}
}
Immediately after this code I do this:
ICollection<ElementId> deletedElements = e.GetDeletedElementIds();
ICollection<ElementId> changedElements = e.GetModifiedElementIds();
ICollection<ElementId> addedElements = e.GetAddedElementIds();
The problem is that for deleted elements this works perfectly (after a reload) but for modified and added elements this does nothing.
The code works perfectly when adding or modifying elements in the local file, but this is not what I need. I need to handle modified and added elements from other users who synced these changes to the central file.
Does anybody know if I am doing something wrong, or maybe there is some other way to accomplish this?