1

I want set color to elements. In Revit 2019 and early works well, but after 2019 its can override only Line graph settings. I need colored like a solid.

SetProjectionFillColor in 2019 code:

OverrideGraphicSettings ogs = new OverrideGraphicSettings();
ogs.SetProjectionFillColor(new Color(255, 0, 0));
ogs.SetProjectionFillPatternId(solidFill.Id);
using (Transaction transaction = new Transaction(doc))
{
   transaction.Start("Colorize");
   foreach (var id in allNeddedElement)
   {
     doc.ActiveView.SetElementOverrides(id, ogs);
   }
   transaction.Commit();
}

SetProjectionLineColor in later than 2019

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Bender__SS
  • 21
  • 4

1 Answers1

1

Need do like this for result.

        ogs.SetSurfaceBackgroundPatternColor(new Color(255, 0, 0));
        ogs.SetSurfaceBackgroundPatternId(solidFill.Id);

        ogs.SetSurfaceForegroundPatternColor(new Color(255, 0, 0));
        ogs.SetSurfaceForegroundPatternId(solidFill.Id);
Bender__SS
  • 21
  • 4
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 26 '23 at 00:54