Paint All Faces of Selected Elements
1️⃣ Select Material
First of all I get all materials with FilteredElementCollector
class and then I create a UI form using pyrevit.forms.SelectFromList
function. You can get more information about it in pyRevit's Dev Doc - Effetive Inputs
2️⃣ Pick Elements
Then I use Selection.PickObjects method to allow user to select multiple elements, that should be painted. I also used pyrevit.forms.WarningBar to create an orange bar on the top, so it's more clear for the user what to do.
3️⃣ Paint Faces
Lastly, I painted all the faces. I had to get Geometry and iterate through its faces. And one I got the faces I used doc.Paint method to paint them.
⌨️ Happy Coding!
Erik Frits