<aside> <img src="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/01f9b8a6-3c36-442b-bed3-ec193007d66f/ic_01_idea.png" alt="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/01f9b8a6-3c36-442b-bed3-ec193007d66f/ic_01_idea.png" width="40px" /> Start with the short introduction to bundles at Create Your First Command This document lists all supported pyRevit bundles and is the main reference to all their functionality.
</aside>
<aside>
<img src="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/01f9b8a6-3c36-442b-bed3-ec193007d66f/ic_01_idea.png" alt="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/01f9b8a6-3c36-442b-bed3-ec193007d66f/ic_01_idea.png" width="40px" /> See Bundle Metadata for more information on bundle.yaml
metadata file
See Bundle Lib & bin for more info on the bundle lib/
and bin/
directories
</aside>
Command bundles are the smallest unit of executable code in pyRevit. In most cases, they show up as a button on the Revit UI, and can be executed in a variety of ways.
The requirements and conventions below are shared among all command bundles
You can use provide highlighting directives inside the command bundle metadata. Revit will highlight the button and the tooltip in the interface.
# highlight as new
highlight: new
# highlight as updated
highlight: updated
Push Button bundles include a script that is executed fresh, every time the user clicks on the button. They are the most used bundle in pyRevit.
extension: .pushbutton
requires:
- *script.* # note the wildcard. BuildWall_script.py or Analyse-script.cs are both acceptable names
- bundle.yaml # includes bundle metadata e.g. tooltip message
# OPTIONAL for python scripts only.
# python scripts can use the __var__ convention to set bundle metadata
optional:
- *config.* # optional config scripts. Revit UI will show a ● in front of the button name e.g. "Match ●"
# Shift-Clicking the button, launches this config.* script instead
- icon.png # for Revit UI icons
- icon.png # for Revit UI icons in **Dark mode**
- tooltip.png # for Revit UI button tooltip image
- tooltip.mp4 # for Revit UI button tooltip video
- *help.* # for Revit UI button help, opening with F1 key
- lib/ # can include a lib/ directory that hosts modules required by the bundle code
- bin/ # can include a bin/ directory that hosts binaries required by the bundle code
Push-Button bundles can contain a IronPython *.py
file as their main script. pyRevit will run the script with the active IronPython engine.
See Anatomy of IronPython Scripts for more detail on IronPython scripts.
See Configure pyRevit for more information about setting the active IronPython engine version.