Requirements Basic undestanding of python programming language, and Revit API

Let's talk about pyRevit Bundles, mostly focusing on:

What's a Bundle?

Bundle is basically a group of resources, placed inside a folder, with a special name.

For example, pyRevit command bundles usually include a python script file (script.py), and an icon (icon.png). These files are placed inside a folder with a name that ends in .pushbutton. The last part of the naming defines the type of bundle. For example, pyRevit command bundle for Revit buttons are named similar to MyButton.pushbutton. The last part of the name after the dot, is the type of this bundle, in this case, a Push Button.

Here is how the folder and its contents look like. The / at the end of the first line, means it is a directory.

MyCommand.pushbutton/
├── icon.png
└── script.py

What's an Extension?

pyRevit extensions are a type of pyRevit Bundles. Their name ends in .extension

Extension bundles, are basically groups of other bundles (mostly command bundles). pyRevit has been designed to find these extensions when starting up Revit, and create buttons and other user interface components for the bundles inside the extension.

Now let's make our first extension

Creating the Extension Bundle

pyRevit’s extension bundles are designed to be flexible and easy to work with. Here, we will dive right into how you can create your own extension, but let’s answer one important question first:

Question

Why would I need to create a separate extension? Why can’t I just add my scripts to the current pyRevit tools?

Answer

By creating separate extension bundles, you will have all your precious scripts and tools in a safe place and away from the changes being made to the pyRevit core tools. Your extension bundles can even live somewhere on your company shared drives and be shared between your teams as well.