How to paint every wall surface

Nice write up, @jacob.small :slight_smile:

You covered everything there is to cover, but I thought I’d just chip in as well:

Python Script:

import clr
import sys

sys.path.append(r'C:\Program Files (x86)\IronPython 2.7\Lib')

clr.AddReference('RevitAPI')
clr.AddReference('RevitServices')

import Autodesk
import RevitServices

from Autodesk.Revit.DB import *
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc =  DocumentManager.Instance.CurrentDBDocument


faces = UnwrapElement(IN[0])
elems = UnwrapElement(IN[1])
material = UnwrapElement(IN[2])
bool = IN[3]

output = []

if bool:
	try:
		errorReport = None
		TransactionManager.Instance.EnsureInTransaction(doc)
		for i,j in zip(faces, elems):
			doc.Paint(j.Id, i, material.Id)
			output.append('Wall with Element Id ' + '{}'.format(j.Id) + ' was painted')
		TransactionManager.Instance.TransactionTaskDone()
	except:
		import traceback
		errorReport = traceback.format_exc()
		
	if None == errorReport:
		OUT = output
	else:
		OUT = errorReport

else:
	OUT = 'Set bool to true' 

This does feel a bit glitchy though, and the workflow should be optimised according to Jacobs explenation, regarding walls going through multiple rooms. It also seems to not like curtain walls very much. But anyways - here’s something to work with, as a suplement to Jacobs solution.

Good luck :slight_smile: