Вот что получилось у меня.
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('System.Core')
import System
clr.ImportExtensions(System.Linq)
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
kns = IN[0]
list,list1,list2 = [],[],[]
kns1=kns.Where(lambda x: UnwrapElement(x).LookupParameter("Марка").AsString()> 0)
kns2=kns.Where(lambda x: UnwrapElement(x).LookupParameter("Марка").AsString()< 0)
for k in kns1:
k1=UnwrapElement(k).LookupParameter("Марка").AsString()
list1.append(k1)
a = IN[1][0]
c = IN[1][2]
S,T = [],[]
for i in range(len(a)):
for j in range(len(list1)):
if a[i]==list1[j]:
S.append(c[i])
TransactionManager.Instance.EnsureInTransaction(doc)
for s,t in zip(S,kns1):
UnwrapElement(t).LookupParameter("Комментарии").Set(s)
s1=UnwrapElement(t).LookupParameter("Комментарии").AsString()
T.append(s1)
TransactionManager.Instance.TransactionTaskDone()
OUT = list1,kns2,T