1、获取填充图案
FilteredElementCollector fillPatternElementFilter = new FilteredElementCollector(doc);
fillPatternElementFilter.OfClass(typeof(FillPatternElement));
//获取实体填充
FillPatternElement fillPatternElement = fillPatternElementFilter.First(f => (f as FillPatternElement).GetFillPattern().IsSolidFill) as FillPatternElement;
2、修改图元的填充图案与颜色并应用于当前视图 312116是某个元素的id
OverrideGraphicSettings overrideGraphicSettings = new OverrideGraphicSettings();
overrideGraphicSettings = doc.ActiveView.GetElementOverrides(new ElementId(312116));
overrideGraphicSettings.SetProjectionFillPatternId(fillPatternElement.Id);
overrideGraphicSettings.SetProjectionFillColor(new Autodesk.Revit.DB.Color(255, 255, 0));
doc.ActiveView.SetElementOverrides(new ElementId(312116), overrideGraphicSettings);