Get Specific wall face/surface

Hi, i want to design a script which can paint specific wall faces, maybe based on there membrane layers.
I believe i am only one step away from this, all i need is to find a method to identify which face to be painted.
I am already using a python script to get the wall compound layers, also another script to paint selected faces.

All i need now, for example, is to find how to convert (Autodesk.Revit.DB.CompoundStructerLayer to Surface)
Or, to define what is the material of wall surfaces?
I don’t really know how should it work, but maybe someone can help as i explained what is the goal.
I attached the dynamo script if it may explain better

Many thanks in advance.

Auto Paint.dyn (11.9 KB)

I think you are headed down the wrong path. I believe you want the Faces of the object. (Wall > Geometry > Solids > Faces) These contain the material definition. I think the Surface is just used for the path of the object. Surafce is one level below the Face (Or PlanarFace, or CylindricalFace).