oh my… your suggestion… look at the output.
the list order changes … sometimes …
look at [0][1] which has merk, start_lagenmaat which the script will try to pair this up with [0][2] start_lagenmaat, Description … well, that obvious won’t work.
My yesterday’s screencast show several elements not being assigned … well, now we know why. Next step, figuring out why python changes the order of the list.
I’m going to try a zip alternative … unsure if python libraries could cause this issue? (how to check this?)
Coding result parameter order … seems just fine.
TransactionManager.Instance.EnsureInTransaction(doc)
error_report.append(sorted(zip(elemAssoc, famAssoc)))
for pair in ((elemAssoc[c], famAssoc[c]) for c in xrange(min(len(elemAssoc), len(famAssoc)))):
error_report.append(pair)
#for i,j in sorted(zip(elemAssoc, famAssoc)):
# try:
#doc.FamilyManager.AssociateElementParameterToFamilyParameter(pair[0], pair[1])
#doc.FamilyManager.CanElementParameterBeAssociated(i,j)
# error_report.append(pair)
# except:
# error_report.append("can't assign parameter")
TransactionManager.Instance.TransactionTaskDone()