Paint different Material Surface of 1 element

Hello,
I need to paint differrent material on different surfece of 1 element (different waterproofing for horizontal and vertical surfeces of foundation)
i’ve read “Paint Material Surface”, but using the script from the article it turns out to paint whole element in 1 type of material… i’m new to dynamo, mb someone knows how can i filter horizontal and vertical surfeces of element?

Try it using parts.

Thank u, but i can’t correctly split on parts, bcs this element has complex shape

up

Since you’re already feeding the surfaces into the Paint script anyway.

-Use Surface.PointatParameter to find a point in the middel of each surface.
-Use Normal at point to find the normal.
-Filter those on horizontal/vertical
-Feed them into your paint Node either in a list structure or in 2 Paint nodes, 1 for horizontal, 1 for vertical.

Thank u, i’ll try

Hello
I managed to filter out horizontal and vertical surfaces, as you wrote above, but I had a problem that the original script stopped working (surfaces are not painted). As I understand it, this is due to the fact that I get the coordinates of the normal vectors to the surfaces, not the surface … Is there a way to get surfaces back(didn’t find a suitable block), or is there another reason?


Error text:
“Traceback (most recent call last):
File “”, line 36, in
File “”, line 30, in PaintFace
File “”, line 30, in PaintFace
File “”, line 24, in PaintFace
TypeError: Multiple targets could match: GetElement(Reference), GetElement(str), GetElement(ElementId)”

You are filtering the Normal Vectors, not the Surfaces. So the result from the filter are the vectors.

Oh, Thank you very much!)

Hello,
Sorry for the many questions. This error still appears when used on elements that are “cut” from each other.
image
As I understand it, he is trying to color the face returned by the GetGeometryObjectFromReference (elemRef) method, this method returns all geometry objects, in addition to faces, edges, curves, etc.
Therefore, when trying to color the curve, an error is generated.
Is there any way to add a check on python: “so that it only paints those face geometric objects which are “Face” surfaces”. or “if it is impossible to paint on a surface, then this surface is skipped and the script works further”?

Thank you