Calling Element.Faces in Python


Hey All,

I need to integrate the Element.Faces node into Python… I am getting an error, ‘type’ object has no attribute faces…

familyFaces = []
for hosted in itemlist:
   fcs = Element.Faces(itemlist)

I believe the problem is that I need to define the Element.Faces method as coming from:
from Autodesk.DesignScript.Geometry import *

Like this…

familyFaces = []
for hosted in itemlist:
   fcs = Autodesk.DesignScript.Geometry.Element.Faces(itemlist)

But then I get the error message ‘Autodesk’ not defined…

Would anyone be able to help?




sorry but wouldn’t this be:

familyFaces = []
for hosted in itemlist:
   fcs = Element.Faces(hosted)

otherwise there would be no need for the for loop in the first place :slight_smile:


@Jonathan.Olesen well yes ok you’re right :blush:

Please forgive my poorly debugged code… Dyslexia and coding don’t sit well together…

But the problem still remains :stuck_out_tongue:


I think this post will help you :slight_smile:


Thanks for the suggestion, unfortunately I get 'Family Instance Has No Attribute…

I get results from this method… But when I extract faces later, I get no references to work with down the line…

familySolid = []
for hosted in itemlist:
   solid = hosted.Geometry()

Here’s the dyn&rvt… Dim Walls-C.dyn (32.4 KB) dim.rvt (1.9 MB)

I am interested to know how to call these nodes, I can bring in some but not others… there’s a discussion here, but not the final working code…

Thanks again :slight_smile:



Hi @Mark.Ackerley sorry for the late reply, had some other business to attend to :slight_smile:

I think this might be what you are looking for:

import clr
from Autodesk.Revit.DB import *

import Revit

from Autodesk.DesignScript import Geometry as geom

import DSCore
from DSCore import *

elem = IN[0]
output = []
faces = []

elemgeo = elem.Geometry()
for i in elemgeo:

for i in faces:
	for x in i:
		Surfgeo = x.SurfaceGeometry()
OUT = output



Hi @Jonathan.Olesen,

Thanks for your efforts, unfortunately it’s not working :frowning:

Thanks again,



Some other ways that aren’t doing it…!

#surfacesForRef = []
#for i in faceSrf:
#    ref = i.Tags.LookupTag("RevitFaceReference")
#    output.append(ref)

#edgeRefs = []
#for srfedges in faceSrf:
#    srfEdgesRefs = srfedges.Edges
#    for refs in srfEdgesRefs:
#		output.append(refs.Reference)

faceRefs = []
for facerefs in faces:
    for fcrefs in facerefs:

The last one gives ‘Face object has no attribute Reference’…!


I didn’t know that you still wished a multi-directional reference between the geometry in Revit and Dynamo.

The method “SurfaceGeometry” simply creates a dynamo copy of the faces geometry, see here:

I have no idea how you’d convert the geometry to a dynamo surface while maintaining the Revit tags… :confused:

(Also NodeToCode crashes my Dynamo when attempted on “Element.Faces” xD)



Sorry I wasn’t clear :frowning: that’s why I wanted to call the node/method Element.Faces… it seems to be doing this in a magical way…

I believe zero touch nodes should be able to be called from Python? I can do it with other ones, just that one doesn’t obey my call!

Node to Code just gives me x.Faces which obviously confuses Python, because there are other methods with the same name.

So I need to define this method as being from a particular library, Design Script…


But then I get the fail that name Autodesk isn’t recognised…

That’s what I was trying to say in my original post…



Edit. I call the Design Script Library at the top of my code…

from Autodesk.DesignScript.Geometry import *


Isn’t there to call the Revit API or someting ?

I think that it is not possible to call custom nodes in Python.


Hi @mellouze

I don’t think it is a custom node…





Try this:

for i in IN[0].Faces:
OUT = x


Boom! Thanks :smiley:

Apologies for making that so difficult!



No problem! I was kinda surprised that it was that “easy” :stuck_out_tongue: