Set a Parameter in Revit API
Something that was not obvious to me at the beginning was how to identify the input needed to set a specific parameter with the Revit API. Depending on the characteristics of the parameter we need a different input (and we use a different method overload).
The way I consider best to proceed as of now is as follows:
- First, use RevitLookup “Snoop Selection” command to understand better the element I am working with (if it’s a wall, select the wall and then click “Snoop Selection” from the RevitLookup pulldown).
- Once in the RevitLookup UI, we can choose Parameters to see the full list of parameters of the wall element (it’s basically this property that you access through RevitLookup).
- A new window of RevitLookup will open with the list of all parameters of the wall element we clicked at the beginning. Here we can go through the list and identify the parameter we want to change.
- Once the parameter has been identified, we click it and look for the one thing that will tell the input that is needed for setting the parameter: the StorageType. This property can be String, Integer, Double or ElementId.
- Once the StorageType is clear, then we know which of the four overloads of Set Method is needed, meaning, we know which input to use to successfully update the parameter.