Check which user owns an element in a shared model
When working with the Revit API in shared models, we are unable to execute commands on elements that are owned by other users. The following code snippet shows how to handle this issue. For the sake of arguement, let's imagine we want to perform an action on our walls. doc = DocumentManager.Instance.CurrentDBDocument walls = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Walls).WhereElementIsNotElementType() owned_walls = [] unowned_walls = [] for wall in walls: wall_id = wall.Id tooltipInfo = WorksharingUtils.GetWorksharingTooltipInfo(doc, wall_id) owner = tooltipInfo.Owner #If you're interested, you can also check who created the element and who edited it last. creator = tooltipInfo.Creator lastchangedby = tooltipInfo.LastChangedBy if owner != "" and owner != "lorem.ipsum": #The element is owned (it doesn't belong to an empty string), and it...