How to get MaterialId and set MaterialId using python script in dynamo

Hello all!!

I need your help by solving the problem.
I have tried to get materialId from the wall in Revit model and then set materialId into other’s.

But I continue to fail it. Please help me.

I looked at the following figure.

Walls have compound layers so you can’t just set a single material. See if this post gets you headed in the right direction.