Python. Set list of elements parameters values by parameters names

Hello,

I would like to set huge list of parameter values by list of parameter names to elements of Revit with python. I have tested script using the Revit OOTB in the python node but it did not work. I have seen other post that the requirement is to have a paired list of parameter names and values, so if there are 20000 parameters values to set, there are also 20000 parameter names to set.

I am talking about this reference, but I do not achieve to make it work

If you want to use Revit API you’ll probably need to use a zip loop with the names/values/elements as three parallel lists. If you have the same parameter name for many of them you could potentially break up your data into which parameters you are trying to set using separate nodes though where you only target one parameter name instead.

This method retrieves a parameter from an element by name:
https://www.revitapidocs.com/2022/4400b9f8-3787-0947-5113-2522ff5e5de2.htm

From here you can use the set method for that parameter to set its value:
https://www.revitapidocs.com/2022/906458f5-cc02-5972-1272-a59f27739c12.htm

Some limitations will be in place that you may want to check for such as whether the element is checked out for worksharing purposes, or if the element is grouped and has a parameter set from within the group (Revit, Dynamo and addins cannot modify grouped inaccessible parameters as far as I know).

1 Like