LearnRevitAPI

➡️ How To Automate Shared Parameters in Revit in 3 Easy Steps.

Aug 8, 2025
Automate Shared Parameters

Importing Shared Parameters sucks...
It's one of really boring tasks that takes lots of clicks, time and very little brain power... We all hate it, so why not automate it?
And if you don't know how, well let me give you everything you need (just like IKEA box), so you can create your own script.
Let's Unpack Some Code!

Brainstorming
Before you start automating anything in Revit, just go through the process manually and try to break down all the steps you do.

Let's write all manual steps we do:
Click On Add Parameter
Select Shared Parameter
Choose Type/Instance
Choose Parameter Group
Choose 'Values can very by group'
Choose Categories
I bet you do these steps so fast, that you don't even notice it. But once you know it, we just need to follow the same steps with code.
And let's start from the end and look at the documentation. You will find the following method to add parameters:

You can see we only need 3 arguments, let's get them one by one.
💡PS. There are some changes in Revit API 2025+, but it's not hard to adjust the code.
1. Definition
Definitions are the blueprints of your parameters. And we can get ExternalDefinitions from SharedParameterFile.

Here is a complete code snippet that will:
Open SharedParameterFile
Iterate through Groups and Definitions
Sort in a Dict
Create pyRevit.SelectFromList form to select

💡You can adjust the code to anything else if you want other logic on selecting parameters.
2. Binding
The next one is Binding. If you explore docs, you will notice that it's an abstract class and we need to use children classes:
InstanceBinding
TypeBinding
That's how you select if you're adding parameters as Instance/Type parameter.

To Create a binding, we also need to create a CategorySet to provide as an argument inside:
So in this step we are choosing categories and if it's an instance/Type paramter.
Here is the code to create a CategorySet:

💡P.S. There are 2 ways(A/B) how to do that. Choose whatever you like more.
Then we need to decide if we want Instance or Type Binding.

💡We also have 2 options to create this kind of binding. So again, choose whatever syntax you like more:
3. Group
Lastly, we need to choose a ParamegerGroup.

It's very easy because we will use BuiltInParameterGroup Enumeration, so it already contains all possible values same as in Revit UI. Just choose what you want

🚀Put it all Together
Alright, we went through all the steps briefly, now let's just combine it into a single code snippet you could actually start using to automate this boring task with some python code.
Here is full python code:

And here is the end result in action:

I think this little script can already save you a few hours on every project when you need to setup your shared parameters.
So Steal It!

Join Newsletter
📩 You will be added to Revit API Newsletter
Join Us!
which is already read by 9500+ people!




