Way to override certain structural element color and save as view template

Hi,

I am trying to create an automated process to visually mark certain structural elements that I collected in a 2D view by override their color, and I am wondering if anyone knows how I can save such override as a view template that I can turn on and off freely.

The workflow of my process goes as: I have a set of structural framing elements stored in a list. I am able to change their color by set their ProjectionLineColor using OverrideGraphicSettings.ByProperties cell. And I am able to retain the current view using ActiveViewFromCurrentDocument.

But from there I am stuck because once I run such script I am able to see the line colors got changed, but I want to save it as an “overlay” (which in Revit I think it’s either a filter or a copy of the view) so that it won’t interrupt the current view. I think I can use View.AddFilter but I don’t exactly know how and how it can apply to only certain elements instead of the entire category. Thank you very much.

Here’s my dynamo script:

  1. the framing elements in a list that represents the target elements I want to override color to
  2. So here I am able to change the color using override, but how could I save this as a filter instead of straightly apply it to the view?

Hello and welcome

Here is an example to create a filter and add to viewtemplate

1 Like

Hi Sovitek thank you so much I will give a try in no time.

1 Like