LearnRevitAPI

🚀 Your First Step to Automating Parameters with Revit API

Aug 6, 2025

Parameters in Revit API

Revit is all about parameters.

Sometimes we spend days going through Revit model to ensure we have the right parameters so our calculations are correct. And it's really annoying task.

So it's essential to understand How to Get, Read and Set Parameter Values with Revit API. That's how you can create simple tools that can save you not only hours, but days...

So let's dive in.

How to Work with Parameters in Revit API?

When you work with Revit API keep in mind that elements have a list of parameters. It can be:

🔹Built-In Parameter
🔹Project Parameter
🔹Shared Parameter

There are also Global and Family Parameters, but we won't cover them in this newsletter. (Reply if you want a separate email about them.)

To automate your parameters in Revit you need to learn:

  • How To Get Parameters

  • How To Read Parameter Values

  • How To Write Parameter Values

Let's cover it step by step.


1️⃣ How to Get Parameters?

No matter what you want to do, firstly, you need to get the parameter itself from the element.

And it can be confusing to a beginner because there are lots of different methods in the Documentation:

Also, keep in mind that Project/Shared parameters always keep the same name, while Built-In parameters can have different names depending on the language.

Therefore I like to use:

  • get_Parameter for built-in parameters

  • LookupParameter for project/shared parameters.​

Let's look into that.


Get Shared/Project Parameters

These parameters always have the same name. So it's okay to use LookupParameter and provide the name. Very straight-forward.

However, when you use this method, make sure that you actually found the parameter. Because sometimes you can run your script on a new project where this parameter doesn't exist yet.

Here is a simple example:

💡PS. This will also work for Built-In parameters, but it's not recommended because it can get translated by Revit.


Get Built-In Parameters

When working with built-in Parameters, it's best to use get_Parameter and then select the right BuiltInParameter Enumaration value.

Sometimes it might be tricky, so use Revit Lookup to find the right name (Parameter.Definition.BuiltInParameter)

For example for Comment or Type Comments it would be like this:

Then you can get your parameter with code like this:

In this case, it's not necessary to check if parameter exist, because it's already built-in. However, make sure you get it from the right element.

💡Especially when dealing with Instance vs Type parameters.


💡Instance vs Type Parameters

Beginners often get confused with that one.

To get an instance parameter you need to look inside element instance, however to get type parameter you need to get ElementType and then look inside of that.

element.Parameters -> List of Instance Parameters
elem_type.Parameters -> List of Type Paramters

This is because Element and ElementType have different classes in Revit API, and that's how parameters are stored. But it's easy to get once you know it.


2️⃣Read Parameter Values

Now you know how to get parameter.

To read parameter values, you need to use one of the methods depending on the StorageType of a parameter.

Usually, it's very clear. If you work with text parameters like Comments, Mark... you know it stores text values, therefore you'd use AsString().

If parameter reference another element like Level, Material... then you'd want to use AsElementId()...

If in doubt, you can always look inside of RevitLookup and see what values you get with each method.

In this case it's very clear that you need to use AsString to get 'Special Wall' value. You can also see StorageType = String above.

Here is how to read it with Python:

💡 Same applies to both Built-In or Shared Parameters.


3️⃣ Set New Parameter Values

Lastly, how do you override parameter values?

For that we need to use .Set() method to change value, and you need to provide a value with the correct type.

🔓 Also, you need to Start and Commit a Transaction when you make any changes to your project. That's like a guardian of your projects so beginners don't break anything by accident and only apply intentional changes.​

💡NB! You also have to provide the value with the correct Type (Text, Integer, Float, ElementId). If you provide the wrong type, you won't get any error messages, but it also won't change parameter value. And it can confuse a lot of beginners.


Bonus Example

Now let's put it all together and practice.

Create a pyRevit button or open RevitPythonShell and try this code yourself to get more clear on what's going on.

✅ Try to get Shared / BuiltInParameters
✅ Read their values
✅ Set New Values​
✅ Bonus: We can also iterate through a list of all parameters

Here is the code:

💪Try it out!
It will help you get more clear on parameters in Revit APi.


P.S.

If you want to get more in-depth explanation about Revit API parameters, you can check this YouTube Tutorial.

This will help you get visual on how parmaters actually work in Revit API.

Enjoyed Newsletter?

Leave a Testimonial Here.

⌨️ Happy Coding!
Erik Frits

Join Newsletter

📩 You will be added to Revit API Newsletter

Join Us!

which is already read by 9500+ people!