How to Install and Run Revit Python Shell

Revit Python Shell or RPS is a good way to write Python codes in Revit and create plugins. It’s a free script editor integrated into Revit API that gives you the benefit of seeing the result as you code.

Use it in combination with Revit Lookup. It has below three features.

  • Interactive Python Shell
  • Non-modal Shell: Not interfering with the Revit model
  • Deploy RpsAddin: Make plugins for Revit

Revit Python Shell in Revit

But first, we will see how to install RPS in Windows.

  1. Go to the RPS GitHub page and download the installer for your respective Revit version.
    Run the installer and check if the RPS appears on your Add-ins tab in Revit.
  2. If not, download the whole master code zip from the Github page.
  3. The installer would have created the below directory in your C drive.RPS install
  4. Go to the below location and make an ADDIN manifest file by pasting the code. Make sure to give it the right path of the RevitPythonShell.dll file from the previous step.
    <?xml version="1.0" encoding="utf-8" standalone="no"?>
    <RevitAddIns>
      <AddIn Type="Application">
        <Name>RevitPythonShell</Name>
        <Assembly>C:\Program Files (x86)\RevitPythonShell2019</Assembly>
        <AddInId>GENERATE_AND_INSERT_GUID_HERE</AddInId>
        <FullClassName>RevitPythonShell.RevitPythonShellApplication</FullClassName>
        <VendorId>RIPS</VendorId>
      </AddIn>
    </RevitAddIns>

ADDIN file

5. Unzip the downloaded revitpythonshell-master package from step 2 and copy the        contents of the folder revitpythonshell-master\revitpythonshell-master\RevitPythonShell\DefaultConfig and make a folder with RevitPythonShell2019 or whatever version the Revit version you want to work with and paste the contents into this folder at the path shown in the image below.

RPS download

Launch the target Revit version and accept the RevitPythonShell popup with Always Load. The RevitPythonShell ribbon should appear under Add-ins tab.

Making and Deploying RPS Addin

An RpsAddin refers to a Revit Addin that was written using the RevitPythonShell and then bundled for deployment using the “Deploy RpsAddin” feature of the RevitPythonShell.

RpsAddins allow you to easily deploy your scripts without having to install and configure RevitPythonShell on each machine. It does this by creating a Revit DLL that can be used as an Addin. This DLL will use some runtime glue code located in RpsRuntime.dll to provide IronPython integration for the Addin. The DLL also contains your scripts and a manifest for the addin as string resources.

In a future post, we’ll see to create and deploy an RPS addin. Till then, download the guidebook for Python Scripting with RPS from here.