Problem with Setting Sequential Values in "Comments" Parameter Using Element.SetParameterByName in Dynamo

Hello,

I’m encountering an issue with assigning sequential values to a parameter for multiple elements. Here’s the situation:

  1. I have two lists:
  • List 1: Contains 278 door elements from the Revit model.
  • List 2: Contains 278 names (text values) that I want to assign sequentially to the “Comments” parameter of the doors.
  1. I’m using the Element.SetParameterByName node with the “Lacing” set to Longest, expecting each value from List 2 to be assigned to the corresponding door in List 1.

The problem: Instead of assigning the values sequentially (e.g., Name 1 to Door 1, Name 2 to Door 2, etc.), Dynamo assigns the same value (the first value from List 2) to all the doors in List 1.

What I expect: Each door should get a unique value from List 2 in the same order as they appear in the lists.

Has anyone experienced a similar issue or knows how to correctly map the values so that they are applied sequentially to each element? I would appreciate any suggestions or guidance!

List1:


List2:

After running the script, all doors receive the same value in the “Comments” parameter instead of getting unique values from the list.:

Thank you in advance!

Flatten both lists. The nesting is making your life unnecessarily hard.

Of course, I’ve already tried flattening both lists to ensure there’s no unnecessary nesting, but the same problem persists—each door still receives the same value in the “Comments” parameter instead of unique values.

Did you also try List.Flatten with the last node back on auto or shortest.

You can also try to cycle the Parameter x times.

Though just flatten both lists (like Jacob said) should have worked. At least that was what I thought too.

Apologies, my mistake. The List 1 values to be written into the parameter are all the same, and the script is actually assigning them correctly.