How to change the color of the Revit wall

Hi

I would like to change the color of the walls. Problem is how to read the current wall type and generate from it a new type. Analyze Wall or Element Type Picker list nicely the wall type but how to get the current material (and color) out of it and rewrite a new type? I tried the read Element Material out from the wall element but result is empty.

If there would be elements in the model the material of them could be read (figure below). Still this is not the solution I am looking for because 1. there must be one element made before GH can be run. 2. If there are several walls in the model Type Instances output all of them even if the type of them is the same.

Take a look at this definition please. Files are attached (Revit 2020)

WallFinish.gh (22.8 KB) WallFinish.rvt (352 KB)

This should give you an idea of how to extract the material from wall layers. This example grabs the materials from the inner face and outer face or the wall and changes their color

You can duplicate the wall type and material but currently we don’t have a component to replace the compound structure of the wall so I made a python component for you

1 Like

Thank You very much! This works perfectly.

As a dessert I wonder what kind of loop will be needed to Python code if there are several colors?
# change Revit document here
CS.SetMaterialId(LIDX, M.Id)
WT.SetCompoundStructure(CS)

Then the end result could be the checked colours of elements.

1 Like

GH is a functional programming environment so ‘loops’ are handled by providing a list of wall types and colors as input. You can probably map an image and sample at different locations to select the colour maybe (Query walls -> grab their center -> sample an image on each location or decide which color to use -> apply the color to the type using the same python component)