Assign Paints to All Surfaces

Hi everyone,

I wonder how to assign paints properties to all surfaces with one click.
Is it possible?
Thanks for giving advice.

@DynaGirlBIM why don’t you assign a material in that case to the element? Nevertheless, try this:
image

import clr

#Import the Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *

#Import DocumentManager and TransactionManager
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

#Reference the active Document and application
doc = DocumentManager.Instance.CurrentDBDocument

elems = UnwrapElement(IN[0])
newMat = UnwrapElement(IN[1])


gOpts = Options()

TransactionManager.Instance.EnsureInTransaction(doc)
geom = elems.get_Geometry(gOpts)
for j in geom:
	face = j.Faces
	for f in face:
			#if doc.IsPainted(i.Id, f):
			#if f.MaterialElementId == oldMat.Id:
		doc.Paint(elems.Id, f, newMat.Id)
TransactionManager.Instance.TransactionTaskDone()

OUT = elems

Paint.dyn (6.9 KB)

3 Likes

@Elie.Trad ,

This script is awesome for me. One click and all surfaces painted :wink:
Thank you so much :pray: :ok_hand:

2 Likes

@Elie.Trad Greetings. Firstly yes your script works awesome. Super thanks for that. But how do i do this for multiple elements. It only allows me to select single element.

I want to map a list of materials to a list of floors.