
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hey there,
I have a tool which deletes fill patterns in a family. Up till Revit 2014 it worked, but now in 2015 it doesn't anymore.
It looks like the standard Fill Patterns like Solid fill, Vertical, Diagonal up, Crosshatch ect. can't be deleted anymore??
With RevitLookup I concluded that all 'standard' fill patterns have an ElementId which consists of less digits then 'user fill patterns'.
So I've made the workaround like below, but this will only bypass them. Does anybody know how I can delete these standard fill patterns in a family ?
public static void RemoveFillPatterns(Document doc)
{
List<FillPatternElement> fillp = new FilteredElementCollector(doc).WherePasses(new ElementClassFilter(typeof(FillPatternElement))).OfType<FillPatternElement>().ToList();
foreach (FillPatternElement HatchPattern in fillp)
{
try
{
if (HatchPattern.Id.ToString().Length > 5) doc.Delete(HatchPattern.Id);
}
catch (Exception ex)
{
// apperently a standard fill pattern which can't be deleted in 2015
MessageBox.Show(ex.Message);
}
}
}
Solved! Go to Solution.