LearnRevitAPI
![](https://framerusercontent.com/images/zMFB840Y52OLteloUT4BRuogE.png)
![](https://framerusercontent.com/images/U9zjOvD4k3m6cIJd5bOiu960DeI.png)
Dec 4, 2022
![](https://framerusercontent.com/images/Sd5FTaxiqzG7oeH1ykV6yypUzXo.png?scale-down-to=512)
Reading and changing parameters is the whole premise of Revit, because that's where the data lives and it controls everything. So it's crucial to understand How To Read and Set New Values
Parameter Types
There are 5 different parameter types,
but I will cover the first 3.
🔹Built-In Parameter
🔹Project Parameter
🔹Shared Parameter
🔸Global Parameter
🔸Family Parameter
How to Get Parameters?
Project and Shared parameters are quite easy to work with, we can get them with their Name, since it will not change in different Revit Languges.
However, Built-In parameters can change display names. Therefore they have unique internal name assigned to them, e.g.
InternalName:
BuiltInParameter.ALL_MODEL_INSTANCE_COMMENTS
DisplayName:
English: Comments
German: Kommentar
You can use Revit LookUp to look inside parameters to find Internal Name. The property is located in Parameter.Definition.BuiltInParameter
It's possible to get Built-In Param by name, but your script will crash in other Revit Languages, therefore we need to use internal name whenever we deal with Built-In Parameters
Let's look at different methods to get Parameters
![](https://framerusercontent.com/images/5nyVJe5eoYzwzEIuwi97wDGOqfM.png)
Built-In Parameter
.get_Parameter(BuiltInParameter)
If you setup Revit API Autocopmlete, then it's quite easy. Once you put a dot after BuiltInParameter it will suggest you Internal names.
![](https://framerusercontent.com/images/MEAUUpPVER8o8kn7xgLXQO8IM.png)
Project/Shared Parameter
.LookupParameter('Param')
This method is straight-forward. Just write name of your parameter and it will try to get it. But make sure it exists in the project and you spell it correctly!
How to Get Paramter Value?
![](https://framerusercontent.com/images/hVdquXpINxR7BL10euoI2cqJ5CQ.png)
🔸 Methods
There are different methods to get different values based on Data Type.
You can always have a look inside parameters with Revit Lookup to be sure which one to use.
As you can see in the screenshot I know that .AsString() is going to return 'Special Wall'
How to Set Parameters?
To set a parameter, first of all we need to get it and then we can use .Set() method and provide the right value.
And since we are modifying the project, we need to create a Transaction(I will have separate email about them)
👇 Have a look at the example below
![](https://framerusercontent.com/images/JTQjsN53XVnOl79yV3cKdTnq0c.png)
P.S. It will not do anything if you are trying to set the wrong Data Type.
If you will try to set a number to a Text Parameter it will not give you an error, but it won't do anything. And it can drive you crazy that nothing is happening.
😅I speak from experience...
Here is an example
💪 Give it a try yourself!
Open RevitPythonShell and write this,
it will get more clear what is going on.
✅ Try Getting a few BuiltInParameters. Read and Set values.
✅ Do the same with Project/Shared Parameters
![](https://framerusercontent.com/images/WYEvySbOvwODcEMjIhUU5Ji8z48.png)
⌨️ More Examples
I have prepared a python file with more examples on Getting and Setting parameters. Have a look, it's easier to understand when you see an example.
🎦 Video Tutorial
Dive deeper with my Tutorial on Revit API Parameters
👇
![](https://framerusercontent.com/images/eAQh4O75bx6fwnxIQTWYb7Lvk8.png)
How to Get/Set Parameters with Revit API
Learn how to use parameters with Revit API.
👀 Watch it
Join Newsletter
📩 You will be added to Revit API Newsletter
Join Us!
which is already read by 6700+ people!
![](https://framerusercontent.com/images/svHzzMLtnnRCxtCUwbgAm6CUeB8.jpg)
![](https://framerusercontent.com/images/Y44kwhY0i7q37LzXUjrlxeGUo.jpg)
![](https://framerusercontent.com/images/lqKYmh8rqwZwgY2C9MSQER6iBCI.jpg)
![](https://framerusercontent.com/images/SyGCvJ3dbHsJEyklWWBhweY.jpg)
![](https://framerusercontent.com/images/DwiaUdmQHs3FVdDH2PXwAr0Y.jpg)