Maybe this tool already exists, but if not could somebody make a wipe selected tool? It would be cool to be able to select a row of doors and just delete them from the entire project all at once.
I may be missing something but I don’t see any tools of his to delete the families from the project. You see, the problem isn’t selection, its removing those families from the project. Say I start a commerial tenant improvement project and I know I won’t need any of my residential door families… I want to just select them all in 3D. (All my families are laid out in 3D in my template) and just remove them from the project. This is in order to lightweight the project. To be clear I want to remove the families from the project. Not simply delete the instances.
This will delete all family instance elements in the current selection from the model. You can expand on this script below to include other elements that are not family instances.
from Autodesk.Revit.DB import FamilyInstance from rpw import db uidoc = __revit__.ActiveUIDocument doc = uidoc.Document #Get current selection current_selection_ids = uidoc.Selection.GetElementIds() #get families from current selected element id's family_to_delete =  for id in current_selection_ids: element = doc.GetElement(id) if type(element) == FamilyInstance: family = element.Symbol.Family family_to_delete.append(family) #Filter for unique families in selection seen = set() unique = [family for family in family_to_delete if family.Name not in seen and not seen.add(family.Name)] #delete families with db.Transaction("Delete Selected Families"): for family in unique: doc.Delete(family.Id)
Dang! Heck yes! Can’t wait to try this bad boy out… Thank you
It works! Very well… Works on multiple selections all at once. Very awesome. This is already going to be an essential tool. Let me know if I can get you some money for that shoot