Set parameter inside the family it was created

Hi @vuk.vukanic ,
what your are trying to do is set the value of a parameter in the active family. There are no OOTB nodes to do so, but It’s possible with some pyton :

import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import*

clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

param_name = IN[0]
param_value = IN[1]

param_list = doc.FamilyManager.GetParameters()
names = [p.Definition.Name for p in param_list]
par1 = None
if param_name in names:
	par1 = param_list[names.index(param_name)]
if par1 != None:
	TransactionManager.Instance.EnsureInTransaction(doc)
	try :
		doc.FamilyManager.Set(par1,param_value)
		OUT = 'Success'
	except:
		OUT = 'Failed'
	TransactionManager.Instance.TransactionTaskDone()
else :
	OUT = 'Failed'
1 Like