Element.Geometry node (from Revit) to Python Script

Hello, dear friends,

how to excecute the action from Element.Geometry node inside of Python Script? Can’t find the solution… Please, help! :3



Are you trying to use the node equivalent or the backend method? For the node, simply try this:


If you want to dig deeper, you’ll need to check out the freely available source code here:

There’s a ready-made “Convert” method, so all we need to do is to get to the Revit primitive and apply the conversion method:

1 Like

Hello, dear.
What I want is exactly in your first screenshot.
This is weird, because I have already tried to use .Geometry()! But it works now… Maybe, I was drunken too much.
Thank you!


How to convert code in pic 1 and pic 2 to revit python shell, when i use element.Geometry in revit python shell, the result is not Solid, and in pic 2, i can not use method Convert(),

Can you please show me that code in revit API (i use revit python shell)

Thanks you !!

still need help !!!

still need help !!!

You always need help, but never help anyone.

How did you know that ??

If you don’t want to help me, or don’t know the answer, please don’t comment like spammer.

Could you show me the last time you helped someone on this forum?

Evil Spammer


Why you care about my help, this is very important with you ?? Maybe you care about you obtained than things you can help someone ?? :slight_smile:


If you have ever use revit python shell, it’s different than dynamo, with dynamo just use element.geometry, i finding a solution in revit python shell and it’ using python code not in C#, if i use C# it’s very easy to me.


Seriously?.. I mean real help. The user is not using Revit Python Shell… You’ve noticed, right?..

Dimitar’s solution:

Good luck.

Thanks you for your help, i try this code before, but i don’t know why my python shell get error. You can see the picture attached below, please advise me.

Sorry, unfortunately my script doesn’t work anymore, when i use the Convert() method Revit crashes. In your script the error is in line 7, something related with that reference.

I’m using Revit 2014 and the Installer for Autodesk Revit 2014.

Thanks. I found solution for this issue, my code like this :
<div style=“color: #222222;”>
<div class=“IVILX2C-Db-b” style=“color: #888888;”>selection = [ doc.GetElement( elId ) for elId in revit.ActiveUIDocument.Selection.GetElementIds() ]

opt = Options()

for i in selection:
geo = i.get_Geometry(opt)
for a in geo:
geo = a.GetInstanceGeometry()
for g in geo:
if ( g != None) & (g.Faces.Size >0):
print g.ComputeCentroid()</div>

Oh, you need the geometry of family instances, hahaha.