# Revit Nodes in Python

**URL:** <https://forum.dynamobim.com/t/revit-nodes-in-python/36319>\
**Category:** Revit\
**Tags:** python, dynamo\
**Created:** [May 22, 2019, 9:42pm UTC](https://forum.dynamobim.com/t/revit-nodes-in-python/36319 "2019-05-22T21:42:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![joaoluiz.sribeiro](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@joaoluiz.sribeiro](https://forum.dynamobim.com/u/joaoluiz.sribeiro)\
**Post date:** [May 22, 2019, 9:42pm UTC](https://forum.dynamobim.com/t/revit-nodes-in-python/36319/1 "2019-05-22T21:42:19Z")

</div>

Hi Guys!

I want to know how I can put a Revit node inside a script in python. I had read a lot but don’t found any solution. I just want GetParameterValueByName.(I know about the node inside the dynamo, but I want to create a different function and I need to get the parameter inside the script).

Example:

 ![Sem%20t%C3%ADtulo](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/a/2ad470bd0dfbf077134c38a0e23011398d97de33.png)

Thanks!! =)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [May 22, 2019, 11:02pm UTC](https://forum.dynamobim.com/t/revit-nodes-in-python/36319/2 "2019-05-22T23:02:58Z")

</div>

If you’re going Pythyon to build other functions, you’re likely best of calling the Revit API directly not calling the Dynamo node to call the Revit API.

> **[GetParameterValue Method](https://www.revitapidocs.com/2020/c1af0433-3e94-6e40-429b-ad77aaeaff73.htm)**
>
> Online Documentation for Autodesk's Revit API: 2015, 2016, 2017, 2017.1, 2018

Of course you’ll need to convert that code to Python calls and ensure you’re loading the right API libraries of course. There is an example in the ‘code’ section of the site here: [Revit API Docs - Code Samples](https://www.revitapidocs.com/code/)

---

<div class="post-metadata">

**Author:** ![joaoluiz.sribeiro](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@joaoluiz.sribeiro](https://forum.dynamobim.com/u/joaoluiz.sribeiro)\
**Post date:** [May 23, 2019, 2:35am UTC](https://forum.dynamobim.com/t/revit-nodes-in-python/36319/3 "2019-05-23T02:35:37Z")

</div>

@jacob.small  
Thanks for the help man! =D  
but I don’t understand very well, sorry.  
I tried something like that (EX1), but not work…=(  
I will try more thinks and I will give feedback here.

EX1:

 ![Sem%20t%C3%ADtulo](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/b/fb85852909c6b1be2ffe84237bcdc29f51daf224.png)

---

<div class="post-metadata">

**Author:** ![kennyb6](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kennyb6](https://forum.dynamobim.com/u/kennyb6)\
**Post date:** [May 23, 2019, 2:57am UTC](https://forum.dynamobim.com/t/revit-nodes-in-python/36319/4 "2019-05-23T02:57:50Z")

</div>

For what it is worth, the reason your python script wasn’t working is because Python handles lists differently than Dynamo’s nodes. In node form, it will automatically iterate on every item in the list but in Python, everything has to be very explicit.

This means that in Python, your input `ELEMENTS` is a list, not the actual element. You have to use a for loop to go through each element in the list and then run the .GetParameterValueByName function on the element.

It might be best to try googling some basic python/scripting tutorials to get a handle on things like for loops if you plan on using python.
