Revit Dynamo Combining Spring node family instance by geometry with Associate Family parameter

Hi everyone, i am quite new with Dynamo and I am having some issues trying two combine two nodes in order to be able to export a geometry as a family using the Spring node family instrance by geometry, by instead of adding a material to the created element I would rather link this element to an associate family parameter created previously in the template I am using with the Sping node. I have tried using the python script developed by @awilliams and @3Pinter but was enable to put the two scripts together. (Associate family parameter in a family)

I hope what I am trying to do makes sense. Any help would be appreciate :wink:

Here is the Python script they have been developing last year :

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

clr.AddReference('RevitNodes')

import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

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

doc = DocumentManager.Instance.CurrentDBDocument


elements = IN[0]
epSearch = IN[1]
fpSearch = IN[2]

if not isinstance(elements, list):
	elements = [elements]
if not isinstance(epSearch, list):
	epSearch = [epSearch]
if not isinstance(fpSearch, list):
	fpSearch = [fpSearch]

for e in elements:
	e = UnwrapElement(e)
	elemParams = e.Parameters

	epNames = []
	fpNames = []
	elemAssoc = []
	famAssoc = []
	
	for ep in elemParams:
		epNames.append(ep.Definition.Name)
		
	epDict = dict(zip(epNames,elemParams))
	elemAssoc = [epDict.get(ep, "none") for ep in epSearch]
	
	famParams = doc.FamilyManager.Parameters
	
	for fp in famParams:
		fpNames.append(fp.Definition.Name)
		
	fpDict = dict(zip(fpNames,famParams))
	famAssoc = [fpDict.get(fp,"none") for fp in fpSearch]
	

	TransactionManager.Instance.EnsureInTransaction(doc)
	
	for i,j in zip(elemAssoc,famAssoc):
		try:
			doc.FamilyManager.AssociateElementParameterToFamilyParameter(i, j)
			error_report = "No errors"
			
		except:
			error_report = "can't assign parameter"
	TransactionManager.Instance.TransactionTaskDone()


OUT = elements,error_report