I am having trouble deleting all Fill Pattern Elements from a family document. I am creating scripts to remove elements from our office family templates, and have an issue when it comes to deleting all fill patterns.
I am fairly new to python and I might have made a mistake in the code or it might be trying to delete the internal solid fill pattern? In RevitPythonShell its saying that ElementId cannot be deleted so maybe I need to filter the Solid Fill pattern out?
If someone could point me in the right direction it would be much appreciated
# Delete all fill patterns fill_pats = FilteredElementCollector(doc).OfClass(FillPatternElement).WhereElementIsNotElementType().ToElements() t = Transaction(doc) t.Start("Delete Fill Patterns") for fill in fill_pats: doc.Delete(fill.Id) t.Commit()