Dynamo – Read, Delete, and Replace Family Parameters (with Formulas and Shared Parameters)

Hi everyone,

I’m working with Revit families that contain both standard and shared parameters, many of which include formulas. I’m trying to figure out whether the following workflow is possible using Dynamo (possibly with Python scripting):

  1. Read all parameters from the family, including shared parameters and formulas
  2. Delete specific parameters – for example, a parameter named AA_XX
  3. Replace it with a new shared parameter (e.g., BB_XX) that already exists in my shared parameters file
  4. Assign the same formula that was originally in AA_XX to the new parameter

Essentially, I want to replace a parameter with a different shared parameter while preserving the formula logic.

Has anyone done something similar using Dynamo? Is this workflow fully possible with Dynamo and Python, or would this require a custom Revit add-in using the API? Any pointers, example graphs, or code snippets would be greatly appreciated!

Thanks a lot in advance!

The majority of necessary code for this is available in Python and Crumple nodes.

Generally replacing a shared parameter should retain formulae (like it does in revit naturally). Parameters need to be of the same data type for replacement to work.

The process of replacing shared > shared actually involves first replacing shared with a temporary family parameter, then the shared parameter as these are the only methods the API supports.