Setting up Revit API  Development Environment in vs code .

Setting up Revit API Development Environment in vs code .

Getting started with RevitApi and pyRevit

  1. Download and install the PyRevit setup from the link below. pyRevit helps you quickly sketch out your automation and addon ideas, inside the Revit environment and using its APIs.

    https://github.com/eirannejad/pyRevit/releases

  2. Download and install Revit lookup. From the link below based on your primary Revit version, download the zip file and install. Revit Lookup add-in allows you to explore and navigate the Revit BIM Database

    https://github.com/jeremytammik/RevitLookup

  3. Download and install Revit Python shell. From the link below, choose and download the installation link based on your version. It provides an interactive shell, allowing you to interact with Revit using Python in realtime.

    https://github.com/architecture-building-systems/revitpythonshell

  1. Install the VScode editor if you have not installed it yet.

  2. Install ironPython 2.7 from the link below. IronPython 2.7 is tightly integrated with the .NET framework allowing you to use .NET and Python libraries

    https://ironpython.net/

  3. Install Visual Studio if you would like to install Windows GUI. Make sure to select both Python and NET frameworks during the installation process.

    https://visualstudio.microsoft.com/. This allows you to develop GUI for your plug-ins.

  4. Install Github. This will allow you to progressively save your work in the cloud. https://git-scm.com/download/win

  5. Create a new directory. A placeholder for your plug-in project

  6. Create a virtual environment with a base interpreter as Python 2.7 within your new directory.

  7. Download gtalrico's github repo "ironpython-stubs" : This will be used by Autocomplete engine for common language runtimes(CLR).

    https://github.com/gtalarico/ironpython-stubs

  8. Extract the contents of " ironpython-stubs-master". Go to ironpython-stubs-master> release > and copy "stubs-min" folder. Paste the folder to your project folder > venv

  9. Set up the Autocomplete Revit intellisense for vs code by following the following video by Macro4Bim

  10. Final output. You can now interact with Autodesk classes and Pyrevit