OK… this is done in C# … BUT it’s still a Revit question
I have a model in place item (rectangle extrusion).
If I take the individual lines I get these IDs
If I take the extrusion inside the MIP family I get this ID:
This is the ID of the Model in Place within Revit:
So what on earth ID is my script logging??
private void OnDocumentChanged(object sender, Autodesk.Revit.DB.Events.DocumentChangedEventArgs e)
{
Document doc = e.GetDocument();
// Check added elements for in-place families
foreach (ElementId id in e.GetAddedElementIds())
{
Element element = doc.GetElement(id);
if (element is Family family && family.IsInPlace)
{
// Exclude in-place masses
if (family.FamilyCategory.Id.Value != (int)BuiltInCategory.OST_Mass)
{
// Log the usage and include the ID number
LogModelInPlaceUsage(doc, id);
}
}
}
}