I am currently using the OnDocumentChanged method to find out when an object in the project has been modified which seems to be working for me so far.
I can get the list of modified element ids, and the associated geometry, but I can't figure out how to make the next jump to find what
Material is on this geometry.
this is what I'm doing so far:
foreach (var modified in in_e.GetModifiedElementIds())
{
Autodesk.Revit.DB.Element elem = in_e.GetDocument().GetElement(modified);
Autodesk.Revit.DB.Options opt = new Autodesk.Revit.DB.Options();
Autodesk.Revit.DB.GeometryElement geomElem = elem.get_Geometry(opt);
}
Also, is there an easy way to figure out exactly what was modified about the modified elements? I don't want to reprocess the geometry or the material if they haven't changed.
Solved! Go to Solution.
Solved by Revitalizer. Go to Solution.
Hi cgnk,
if you have the geometry, e.g. Solids, then you could get MaterialElementId from each of their Faces.
I would recommend to implement an IUpdater.
You can define its behaviour by setting its ChangeType properly, e.g. Element.GetChangeTypeGeometry, Element.GetChangeTypeParameter etc.
You also can combine these ChangeTypes to omit unnecessary change notifications.
Best regards,
Revitalizer