I'm running into a problem trying to remove a family from a project. I'm able to delete the family types but it seems like the family is still loaded in the project. Is there a way to remove it completely?
so far, i've looked at these sources:
here's my code:
FilteredElementCollector colTitleBlocks = new FilteredElementCollector(doc)
.OfClass(typeof(FamilySymbol))
.OfCategory(BuiltInCategory.OST_TitleBlocks);
using (Transaction tx6 = new Transaction(doc))
{
tx6.Start("load custom titleblock that you just made");
Element family2Unload = null;
foreach (FamilySymbol xfamily in colTitleBlocks )
{
if (xfamily.FamilyName == "E1 30 x 42 Horizontal")
{
family2Unload = doc.GetElement(xfamily.Id) as Element;
}
}
doc.Delete(family2Unload.Id);
tx6.Commit();
}