Nice code you have there, after a little debbuging I’ve received this error:
global name 'TaskDialog' is not defined
Looks like you need to from Autodesk.Revit.UI import TaskDialog within class function:
Bug is in this section:
def Execute(self, data):
doc = data.GetDocument()
for id in data.GetModifiedElementIds():
element = doc.GetElement(id)
source_param = element.LookupParameter(self.source_param_name)
target_param = element.LookupParameter(self.target_param_name)
if source_param and target_param:
from Autodesk.Revit.UI import TaskDialog
# Transfer the value from the source parameter to the target parameter
target_param.Set(source_param.AsString())
# Here's the issue:
TaskDialog.Show("Parameter Linker", "Updated {} based on {}".format(self.target_param_name, self.source_param_name))
Or just delete/comment this line as after few pop-ups users will hate it.