I think the GetModifiedElementIds() function in Autodesk.Revit.DB.UpdaterData class in Revit API 2014 is not collect all of the changed elements.
For example:
If i change a floor's analytical model, the connecting walls' analytical models are changing too, but the GetModifiedElementIds() function only collect the floor as changed element. Is this a bug or it's willful? Is there a solution to get the changed environmental elements too?
David Schmidt
Dear David,
I am pretty sure that the intention is to return all modified elements in that collection.
I have also heard repeatedly from the development team that this is sometimes quite hard to achieve.
Can you provide a simple, minimal, reproducible case, please?
http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b
Thank you!
Cheers,
Jeremy
Hi!
Thanks for the answer.
Sorry but it's pretty funny you always want reproductible case from the customers, even if it takes 5 minutes to make for any revit developer. I think the problem is really clear. Put a floor with connecting walls ... if you change the floor alignment and want to get the changed elements in a triggered api function, you only get the floor as changed element even if the walls are changed with that.
Have a nice day!
David Schmidt
I'm sorry David but I'm with Jeremy here. How can we help if we can't see what youa re actually doing. As you say it would only take 5 mins of your time to post this and you proabbaly would get an answer staright away.
I'm thinking that you are not creating the right filter when you are setting up your Updater class, and only watching floors being modified and not walls??? See without some code to see what youa re doing it is very hard to help.
Regards
Phillip
A quick answer to David is: An updater should receive ALL the elements that got changed in a given regeneration round, directly or indirectly. That is assuming the updater has the its triggers set up accordingly. It is how updaters work and we have not received a lot of complains. (Internally in the Revit engine, we do not make a lot of difference between elements that got changed directly and those which got modified as a result of change propagation.) However, that is not to say there cannot be any bugs. I have wanted to build a simple app to test what Davit reports as not working, but I have not found the time yet. Sorry. I'll try in the next few days, or, if you upload the code you've been using, David, I'll try that instead.
Thank you
Hi!
I think found the problem in my progenitors code. The geometric change type at triggers is not valid for neighbour refitted analytical models. If i set the change type to "any" the function gives back the neighbour elements too.
Thanks for help!
David Schmidt
Hello David!
I am glad you’ve found a solution. It actually makes sense, since elements of structural analytical model do not have geometry on their own, at least not in the normal Revit sense. It means that if you ask for an analytical model element’s geometry, you ought to get nothing.
Dear David,
Congratulations on solving this, and thank you for letting us know!
Best regards,
Jeremy