# Python Nodes Basics

**URL:** <https://forum.dynamobim.com/t/python-nodes-basics/15872>\
**Category:** Share\
**Tags:** learning\
**Created:** [October 24, 2017, 2:41pm UTC](https://forum.dynamobim.com/t/python-nodes-basics/15872 "2017-10-24T14:41:26Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [October 24, 2017, 3:04pm UTC](https://forum.dynamobim.com/t/python-nodes-basics/15872/3 "2017-10-24T15:04:53Z")

</div>

This third post is about **REVIT API** and **C# TO PYTHON** :

> **[Revit API Forum - Autodesk Community](https://forums.autodesk.com/t5/revit-api-forum/bd-p/160)**
>
> Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.

> **[Revit API 2017.1](https://www.revitapidocs.com/2017.1/)**
>
> Online Documentation for Autodesk's Revit API: 2015, 2016, 2017, 2017.1, 2018

> **[Revit API Docs - Code Samples](https://www.revitapidocs.com/code/#Python)**
>
> Online Documentation for Autodesk's Revit API: 2015, 2016, 2017, 2017.1, 2018

> **[Revit API Docs - Code Samples](https://www.revitapidocs.com/code/#Python_ConvertToPython-py)**
>
> Online Documentation for Autodesk's Revit API: 2015, 2016, 2017, 2017.1, 2018

[http://thebar.cc/converting-revit-api-c-code-to-python/](http://thebar.cc/converting-revit-api-c-code-to-python/)

> **[Autodesk empowers innovators everywhere to make the new possible](https://www.autodesk.com/)**
>
> Autodesk is a global leader in design and make technology, with expertise across architecture, engineering, construction, design, manufacturing, and entertainment.

[http://thebuildingcoder.typepad.com/blog/about-the-author.html](http://thebuildingcoder.typepad.com/blog/about-the-author.html)

> [@How to select and understand the Library?](https://forum.dynamobim.com/t/how-to-select-and-understand-the-library/4641/2):
>
> Hello Rajkumar! This article explains a lot when it comes to how dynamo works with the revit api: [https://github.com/DynamoDS/Dynamo/wiki/Python-0.6.3-to-0.7.x-Migration#revitapi](https://github.com/DynamoDS/Dynamo/wiki/Python-0.6.3-to-0.7.x-Migration#revitapi) The Revit API uses .NET assemblies to give access to functionalities in the program, these assemblies are .dll files. RevitAPI.dll and RevitAPIUI.dll are files that can be found in the Revit program folder. To use .NET with python Dynamo uses a variant called IronPython. How clr and clr.AddReference work is explained…

> [@Plugin to Python Code](https://forum.dynamobim.com/t/plugin-to-python-code/10508/6):
>
> Maybe you can try @Dimitar_Venkov s C# interpreter: (found in the package manager). I just slightly edited the code to include some references and swapped to Dynamos document manager. [image] //Add references using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Autodesk.Revit.DB; using Autodesk.Revit.DB.Structure; using Autodesk.Revit.UI; using Autodesk.Revit.UI.Selection; using Autodesk.Revit.ApplicationServices; using Auto…

> [@Zero Touch - How to return list of elements](https://forum.dynamobim.com/t/zero-touch-how-to-return-list-of-elements/4756/2):
>
> That return statement looks good and it seems to be doing what it’s supposed to inside Dynamo. Tho I’m not sure why you’re generating new lists instead of using the existing lists? I guess your question is how to return a Dynamo element instead? You’ll need to wrap the Revit element like so: types.Add(doc.GetElement(id).ToDSType(true) ) You could also give the new C# interpreter a try. It’s up on the package manager:

> [@Testing Explicit C# Nodes Without Restarting Revit](https://forum.dynamobim.com/t/testing-explicit-c-nodes-without-restarting-revit/4283/5):
>
> If you’re testing something specific, you could always give my Dynamic CSharp Interpreter a go: You can find it on the package manager

> [@Casting in Python](https://forum.dynamobim.com/t/casting-in-python/14198/2):
>
> Because C# is a strongly typed language you have to specify the type for every variable. That’s why it needs casting to a LocationCurve. Python on the other hand does the casting for you, so in this case you should be able to do something like this: curve = l.Curve Because you ask for .Curve property on a Location object Python will figure out that it needs to cast to LocationCurve and then return the Curve.

> [@Revit API & python relations](https://forum.dynamobim.com/t/revit-api-python-relations/9188/2):
>
> Hi sajo We know it’s overwhelming, but you are more likely to get quick responses if you break these questions down into separate posts/subjects. In any case, I will try to touch on some of the points: What does the first four similar lines of every script do…? See comments below import clr # imports Common Language Runtime library .This will serve as a bridge between python and the .NET wold # See this: http://ironpython.net/documentation/dotnet/dotnet.html clr.AddReference('Proto…

---

_[View the full topic](https://forum.dynamobim.com/t/python-nodes-basics/15872)._
