I zeroed in on your problem.
The culprits are the List.SortByKey and List.GroupByKey nodes.
They change the order of the walls (take a closer look at the Element IDs).
So the solution would be to use the Parameter.ParameterByName for “Phase Created” and “Base Constraint” after the List.GroupByKey node (just like you did for the “Area”).
And that should fix everything.
Hope this help.
I have updated the script as per your needs.
I have also cleaned up your graph since it was using redundant nodes.
Updated Script.dyn (39.3 KB)
Let me know if you have any other questions.
Wow amazing! I need to better understand that List.Flatten node.
Eventually you will master that node for sure!
Don’t forget to mark the solution so others can learn from your post!