GeometryColor.ByGeometryColor recognizes the elements but don't change the color properly

hi!
I’m trying to change the color of some surfaces based on a parameter. The function works correctly and recognizes the cylinders but does not change the color and shows me an error color.
How can I solve this problem?


elements

This node doesn’t change the color in Revit but in the Dynamo background preview. You want either to set the material, or override the color in the view.

2 Likes

I was trying this way because I’ve already tried to overriding color and changing material but without success.
I need to change color in every view where the element appear and every project where I load the family, Element.OverrideColorInView gives me this error “View does not belong to a project document.”
So, as you suggest, I pass to change material but I can’t find a way to do it, no block to set material only to read it as Element.GetMaterials. And it’s not a parameter, from Element.Parameters-watch there’s no material on the list, so I can’t find it to change with Element.SetParameterByName

Edit the family and set the material to be a parameter. Load it into the projects. Then set the parameter as desired.