Copy parameter values between Revit parameters is a free Dynamo script that automates the process of transferring data from one parameter to another for any element category in a Revit model. This is especially useful for data migration, when you want to preserve existing parameter values from a parameter before making changes to it.
While the example workflow uses Rooms, the same principle works for other categories such as Walls, Doors, Spaces, Mechanical Equipment, and more. You simply choose the category and define the source and target parameter names.
This script can be implemented entirely with Dynamo nodes or enhanced with a Python Script node for more control over parameter type handling, empty-value checks, and optional filtering.
Workflow:
- Retrieve elements. Collect all elements of the chosen category using the Categories and All Elements of Category nodes.
- Optional filtering. Filter elements by specific criteria, such as “only placed elements” or “elements in a certain phase” (phase filtering applies to categories that support phases, like Rooms or Spaces).
- Get parameter values. Retrieve the values from the specified source parameter using Element.GetParameterValueByName or Python methods.
- Check target parameter. If “Only If Empty” mode is enabled, skip elements where the target parameter already has a value.
- Set parameter values. Write the source parameter value into the target parameter using Element.SetParameterByName or Python methods that handle different storage types (String, Number, ElementId).
- Run and verify. Run the script and review the output.
Key benefits:
- Works with any category in Revit.
- Option to update only if the target parameter is empty, preventing overwriting.
- Optional phase filter for Rooms, Spaces, and other phase-based categories.
- Supports all storage types (String, Number, ElementId).
