# Element.SetParameterByName with 3 lists

**URL:** <https://forum.dynamobim.com/t/element-setparameterbyname-with-3-lists/2606>\
**Category:** Packages\
**Created:** [November 27, 2015, 12:38pm UTC](https://forum.dynamobim.com/t/element-setparameterbyname-with-3-lists/2606 "2015-11-27T12:38:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marc\_Tavenier](https://avatars.discourse-cdn.com/v4/letter/m/9e8a1a/32.png) [@Marc\_Tavenier](https://forum.dynamobim.com/u/Marc_Tavenier)\
**Post date:** [November 27, 2015, 12:38pm UTC](https://forum.dynamobim.com/t/element-setparameterbyname-with-3-lists/2606/1 "2015-11-27T12:38:16Z")

</div>

Hi all,

I’m trying to use the Element.SetParameterByName node with the following three lists:

1. the first list with the elements (walls in my case), this is a one-dimensional list;
2. the list with parameters: each element gets its own list of parameters, so this is a two-dimensional list;
3. a list with the values to set: each element also gets its own list of values to set, so this is also a two-dimensional list.

Here are some examples to clarify:
```
list one (elements):
   [0] element 1
   [1] element 2
   etc.
list two (parameters):
   [0] List:
      [0] parameter 1
      [1] parameter 2
      etc.
   [1] List:
      [0] parameter 1
      [1] parameter 2
      etc.
   etc.
list thee (values):
   [0] List:
      [0] value 1
      [1] value 2
      etc.
   [1] List:
      [0] value 1
      [1] value 2
      etc.
   etc.
```
The image attached might also clarify. In this image it doesn't look like the parameter names nor values vary, but this will have to be possible. That's why I chose to define those parameter names and values for every element in the first case.

How would I go about setting these parameters to the elements, because the Element.SetParameterByName node doen’t take 3 lists. I’ve tried different lacings, transposing lists, making a for loop in a code block (which I failed at), making a Python script with a for loop (which didn’t work as expected). Can anyone help me with this?

As I said I tried using a for loop in a code block, but it says the variables aren’t yet defined which I don’t understand. An image of this code including the error is attached.

Thanks in advance.

Marc

 ![list example](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/5/56312b4e65e1768407902be9c3d463e5565f7b9d.png)

 ![for loop in code block](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/0/052188e5d779088ee345d63052686318e90b287c.png)

---

<div class="post-metadata">

**Author:** ![Vikram\_Subbaiah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vikram_subbaiah/32/50797_2.png) [@Vikram\_Subbaiah](https://forum.dynamobim.com/u/Vikram_Subbaiah)\
**Post date:** [November 29, 2015, 6:53am UTC](https://forum.dynamobim.com/t/element-setparameterbyname-with-3-lists/2606/2 "2015-11-29T06:53:36Z")

</div>

Seee if this works for you

 ![20151129-3](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/1/1bfc1bcab0402ab2e385469d24c2068985dd9b06.jpg)

---

<div class="post-metadata">

**Author:** ![Organon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/organon/32/161404_2.png) [@Organon](https://forum.dynamobim.com/u/Organon)\
**Post date:** [November 29, 2015, 11:42am UTC](https://forum.dynamobim.com/t/element-setparameterbyname-with-3-lists/2606/3 "2015-11-29T11:42:43Z")

</div>

Marc,

Your script works fine, except for the null values. I can´t fix it, sorry.

 ![SetParam](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/d/d5a5ba56781bfddad88d844b6b5667bcf084577e.png)

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

As Vikram has shown, the replication guides are very powerfull.

Regards.
