I have struggled to create Python Code for Dynamo Nodes using the RevitAPI with Visual Studio Community 2015 and Sublime, but it seems it works now with Visual Studio Code. So I have created 2 small tutorials:
How to install Visual Studio Code to Create Python Code with Autocomplete/Intellisense [including the RevitAPI.dll]:
- download the stubs from https://github.com/gtalarico/ironpython-stubs :
-
unblock the zip file after download:
a) right click on the zip file, properties:

b) unblock the file:
-
extract to a folder of your choice on your computer (eg. with WinRar) - recommend is into C:\Test:
-
Install Python 2.7.14 64bit (recommend to the path C:\Python27): https://www.python.org/downloads/windows/ https://www.python.org/ftp/python/2.7.14/python-2.7.14.amd64.msi
[info: Dynamo us using IronPython, but it seems that IronPython is not supporting the Autocomplete function, because of this we use Python2.7.14 to create the Python Code we use later in the Python Node in Dynamo]
-
Install the software Visual Studio Code: https://code.visualstudio.com/download
[further details to Visual Studio Code: https://code.visualstudio.com/docs/languages/python & https://code.visualstudio.com/docs/python/settings-reference ]
-
Open Visual Studio Code and install these Extensions by using the search bar at the top (Erweiterungen [in german]) :
[further details: https://github.com/Microsoft/vscode-python ]

-
To open the user settings use the keyboard combination CTRL + , [in german: STRG + ,]
Add the following lines to the user settings and adjust the path to your stubs.min folder and your python.exe file:
{
“python.linting.enabled”: false,
“python.linting.pep8Enabled”: false,
“python.autoComplete.preloadModules”: [
“Autodesk.Revit.DB”,
“Autodesk.Revit.UI”
],
“python.pythonPath”: “C:\Python27\python.exe”,
“python.autoComplete.extraPaths”: [“C:\Test\ironpython-stubs\release\stubs.min”],
}
- Save your settings and restart Visual Studio Code
*How to explore .dll libraries in Microsoft Visual Studio Community 2015:
[The result of this is similar to revitAPIdocs.com to explore the Revit API, but offline]
Install Microsoft Visual Studio Community Edition 2015… (not further described in this tutorial, use google)
Open the object browser in Visual Studio Community ( Menu: View -> Object Browser )

Create a Custom Component Set:

Add the dll libraries you want to explore:

for example you can add to the object browser:
• ProtoGeometry.dll ( C:\Program Files\Dynamo\Dynamo Core\1.3\ProtoGeometry.dll )
• DynamoServices.dll ( C:\Program Files\Dynamo\Dynamo Core\1.3\DynamoServices.dll )
• RevitNodes.dll ( C:\Program Files\Dynamo\Dynamo Revit\1.3\Revit_2018\RevitNodes.dll )
• RevitAPI.dll ( C:\Program Files\Autodesk\Revit 2018\RevitAPI.dll )
• RevitServices.dll ( C:\Program Files\Dynamo\Dynamo Revit\1.3\Revit_2018\RevitServices.dll )
• DynamoRevitDS.dll ( C:\Program Files\Dynamo\Dynamo Revit\1.3\Revit_2018\DynamoRevitDS.dll )