Get Wall Face by python

Hiii, everyone…
Actually i would like create paint node by room but which requires wall faces so I’m try find the wall faces in packages but its not available and again so I’m try find GetRevitGeometry from RevitAPIdocs but don’t know which one is correct??
Anyone can help me how to get revit geometry or how to get wall faces.

public void Paint(
	ElementId elementId,
	Face face,
	ElementId materialId

If you are using Revit API, you can apply the .Geometry property (or attribute as called in Python - works on most elements):

@habdirad Thanks for your reply… i found new Issue in Paint Method

import clr
from Autodesk.DesignScript.Geometry import *
from Autodesk.Revit.DB import*
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

Faces = []
Geometry = []
Painter = []
walls = IN[0]
Mat = IN[1]
#Wall Faces
for wall in walls:
	Geo = wall.Geometry()
	for f in Geo:
		face = f.Faces
	for Paint in Faces:
		Painter = Paint(wall.Id,Paint,Mat.Id)
OUT = Painted

Okay let’s go with the code attached code.txt (934 Bytes) . Some important changes:

  • Unwrap elements to make them available to API operations
  • Paint is a method of Revit document
  • In the last post, I said Geometry was a method and it is actually a property so I fixed that
  • there is no guarantee that the paint method could paint all faces, so I added a try except structure
  • for the list of faces, I used extend, instead of append, so we end up with a flattened list of faces vs a list of nested lists of faces
  • also please avoid naming your python objects/variables with capital letter, you could mistakenly override API classes and functions

Very thanks @habdirad spend time to solve and explain briefly… i will correct my mistakes here after.