- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello.
I'm trying to paint a wall in Revit 2014. First I get the material and then the faces of the wall, but when I select the wall nothing happens. This is the code in Python:
------------------------------------------------------------------------------------------------------------
def PaintFace(self):
uidoc = self.ActiveUIDocument
doc = uidoc.Document
collector = FilteredElementCollector(doc)
materials = collector.WherePasses(ElementClassFilter(Material)).ToElements()
for material in materials:
if material.Name == 'Copper':
matName = material
break
elRef = uidoc.Selection.PickObject(ObjectType.Element)
wall = doc.GetElement(elRef)
geomElement = wall.get_Geometry(Options())
for geomObject in geomElement:
if geomObject == Solid:
solid = geomObject
for face in solid.Faces:
if doc.IsPainted(wall.Id, face) == False:
doc.Paint(wall.Id, face, matName.Id)
-----------------------------------------------------------------------------------------------------------
Any help is appreciated.
Regards.
Arquitectura | Análisis CAD & BIM | Diseño Paramétrico | Programación
BIM-METADATA | LinkedIn | YouTube
Solved! Go to Solution.