Resources
Lesson Objectives
How To Customize Extension with Folder Structure
Use
bundle.yaml
for Visibility + SortingHow-To Remove/Add Buttons and Panels
Are you Ready?
Summary
Personalize Your Extension
By now you should have your own Revit toolbar that looks like this:
And now I want to show you how to customize it to your own needs. It's 100% customizable so you can remove or add anything you want and it's as simple as copying or deleting a folder.
There are also a few tricks you should know about sorting and why new buttons might not show up, so let me explain you everything you need to know.
pyRevit Folder Structure
As I've mentioned in the previous lesson: pyRevit extensions are based on a very simple folder structure, and therefore we can change a few folders and it will update how our extension looks like.
The best way to understand how it work is to compare what you see inside of the folder structure and what you see inside of Revit. This will help you understand how to modify it to your own needs.
Open .extension
folder we created previously (or use [ALT] + [CLICK] shortcut to open source folder of pushbuttons in Revit). Then we can explore what's going on inside
For example:
If you look inside of 📁…/YourName.tab /PlaceholderPanel.panel
, you will notice a few folders that represent pushbuttons, stack of buttons or pulldown menu. These folders represent buttons inside your pyRevit extension.
You can also look inside .stack
and .pulldown
folders and you will find more pushbuttons.
For example here is what you will see inside of the PulldownExample.pulldown
folder.
There are 3 pushbutton folders and each represents a button inside of Revit UI in your pulldown menu.

Same with StackExample.stack.
You will see pushbuttons and pulldown that relate to buttons inside of Revit UI.
Does it make sense so far?
In addition, you might have noticed that there was one PushbuttonExample2.pushbutton
folder that is not shown in Revit UI.
Just remember that If a button isn’t showing up in Revit you need to check:
Typos in folder names, especially sufixes.
Is it included in
bundle.yaml
file.
Customizing Button Layout with bundle.yaml
Probably you wonder what is bundle.yaml file and why do we need it?
bundle.yaml
is an optional file that can hold additional information about the folder where it's located such as layout order. You can delete it and your extension will still work fine.
If you want to control layout of your buttons or panels you have 2 options:
Use naming for ordering
Use bundle.yaml to specify order
Firstly, keep in mind that you can order your buttons with naming.
For example:
📁button1_Name.pushbutton
📁button2_Name.pushbutton
This way these buttons will show up in the same order as their names inside of Revit. It's a simple and quick way to organize your files.
However, if you want to order your button no matter how you name folders, and to control what is shown or hidden, then you should consider using bundle.yaml file.
Inside you need to use layout
keyword and then specify folder names without suffixes.
Here is a sample:
💡Reload pyRevit after you apply changes. Sometimes you might even need to restart Revit.
💡Your can also control order of .panels
Removing Unwanted Buttons or Panels
Now let's clean up your extension and get rid of a few panels or pushbuttons that you don't want. Based on everything we've just talked about it can't be any simpler.
Just find corresponding folders and delete them and it will be gone in Revit after you reload pyRevit. It's that simple…
If you need help finding the right folders, use [ALT] + [Click] inside of Revit to open source folders of your buttons.
Now practice it by removing something like About or LearnRevitAPI panels.
Adding a New Button
Alright, so what about creating new buttons?
As you've already guessed it, we can duplicate any pushbutton folder and it will create a new button after reloading pyRevit. Or you can create it from scratch.
You will see that each pushbutton folder has:
script.py
- python Script for your button (more on that later…)
icon.png
- Shown Icon in Revit (Should be under 96x96px)

💡Tip: Button Names are controlled inside of script.py file with __title__ = 'Name'
variable. So, don't overthink you folder names but it's best to keep them unique.
💡You can also see icon.dark.png
for dark theme or .xaml
for custom GUI.
Practice creating new pushbutton
Now let's practice a little. I want you to create a new button in your extension.
Open one of the panel folder and duplicate existing pushbutton.
Duplicate pushbutton
Rename pushbutton folder
Find new icon (or leave existing)
Change
__title__ = 'Button Name'
inside ofscript.py
file
Don't worry about the rest of the code for now, we talk about it another time.
You just need to create a new button in Revit Toolbar.
Download an Icon
To get a new icon you can use icons8.com website or any other one. Just make sure it's smaller than 96x96px.
You can also place 2 icons for Light and Dark themes by using the following names:
icon.png
icon.dark.png
Tips for Managing Extensions
Keep
Dev.panel
for work in progress buttons. You can always move pushbutton folders to another panels once they are ready.Stay Organized and use clear names for your folders so you can quickly locate and edit your scripts.
Don't be afraid to experiment. Remember it's just a folder structure
Don't neglect backups. You don't want to lose your toolbar with all your awesome tools. Trust me on that one.
What’s Next
Alright, and by this point you should know how to personalize your extension to your own needs.
You know how Folder Structure relates to your toolbar's layout
You know how to Sort and Hide your tools
You know how to Add or Remove more buttons
And you should start to feel your new super power in Revit
And now it's time for you to practice what you've learnt. I want you to customize your extension by removing panels or buttons you don't need and then adding at least 1 new pushbutton just to practice. It won't take long if you paid attention.
And once you've finished with the homework it's actually time to make these buttons do something useful. And you will love the next lesson as I will show you where you can find a lot of reusable code and how you can make it work for you.
So, see you soon in the next lesson!
HomeWork
Apply what you've learnt during this lesson to customize your own custom Toolbar in Revit.
Remove Panels/Pushbuttons you don't need
Create New Pushbutton
⌨️ Happy Coding!