# Element Types in Python

**URL:** <https://forum.dynamobim.com/t/element-types-in-python/72075>\
**Category:** Uncategorized\
**Created:** [January 7, 2022, 3:45pm UTC](https://forum.dynamobim.com/t/element-types-in-python/72075 "2022-01-07T15:45:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![f.vLion](https://avatars.discourse-cdn.com/v4/letter/f/7c8e57/32.png) [@f.vLion](https://forum.dynamobim.com/u/f.vLion)\
**Post date:** [January 7, 2022, 3:45pm UTC](https://forum.dynamobim.com/t/element-types-in-python/72075/1 "2022-01-07T15:45:36Z")

</div>

Hi,

For a custom code that i’m building. I need the “Element Types” node translated in Python.

![Element Types](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/a/cae3570d10fe7b12a82e05dfad8491a5db125a7b.png)

I tried a lot of FilterElementCollectors and Categorie filters but i can’t get the same result as we can see in this node in Dynamo.

Anybody an idea what’s the right way to filter for this results.

Thanks!

---

<div class="post-metadata">

**Author:** ![georg.grebenyuk](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/georg.grebenyuk/32/169424_2.png) [@georg.grebenyuk](https://forum.dynamobim.com/u/georg.grebenyuk)\
**Post date:** [January 7, 2022, 4:35pm UTC](https://forum.dynamobim.com/t/element-types-in-python/72075/2 "2022-01-07T16:35:49Z")

</div>

I thinking that Dynamo translated internal software’s geometry to itself type - to working with them in Dynamo’s interface (as Dynamo’s objects) and in some situations you will not getting same results as in Dynamo’s node selection’s result.  
That post uninformated… please, add more info about types that you want getting and, of course, software - revit/civil/etc …

---

<div class="post-metadata">

**Author:** ![c.poupin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/c.poupin/32/89152_2.png) [@c.poupin](https://forum.dynamobim.com/u/c.poupin)\
**Post date:** [January 7, 2022, 6:07pm UTC](https://forum.dynamobim.com/t/element-types-in-python/72075/3 "2022-01-07T18:07:04Z")

</div>

Hi @f.vLion and welcome  
here an example

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/9/39f540809bf9552daf15362c460a3077d9a36e03.png)

```auto
import sys
import clr
import System
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
import Autodesk.Revit.DB as DB

DBtypes = []
dictDBtypes = {}
for a in System.AppDomain.CurrentDomain.GetAssemblies():
    if a.GetName().Name == 'RevitAPI':
    	types = a.GetTypes()
    	for spce in types:
    		if spce.IsSubclassOf(DB.Element):
    			DBtypes.append(spce)
    			dictDBtypes[spce.Name] = spce
    	break

DBtypes = sorted(DBtypes, key = lambda x : str(x.FullName))
		
OUT = dictDBtypes

```

---

<div class="post-metadata">

**Author:** ![f.vLion](https://avatars.discourse-cdn.com/v4/letter/f/7c8e57/32.png) [@f.vLion](https://forum.dynamobim.com/u/f.vLion)\
**Post date:** [January 7, 2022, 11:36pm UTC](https://forum.dynamobim.com/t/element-types-in-python/72075/4 "2022-01-07T23:36:15Z")

</div>

> [@c.poupin](#):
>
> ```auto
> import sys
> import clr
> 
> ```

Never come to this by myself but it works!

Thanks!
