# Node Element.SetParameterByName not working properly (?)

**URL:** <https://forum.dynamobim.com/t/node-element-setparameterbyname-not-working-properly/64251>\
**Category:** Packages\
**Tags:** dynamo\
**Created:** [May 22, 2021, 7:10pm UTC](https://forum.dynamobim.com/t/node-element-setparameterbyname-not-working-properly/64251 "2021-05-22T19:10:16Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guilherme](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/guilherme/32/78546_2.png) [@Guilherme](https://forum.dynamobim.com/u/Guilherme)\
**Post date:** [May 22, 2021, 7:10pm UTC](https://forum.dynamobim.com/t/node-element-setparameterbyname-not-working-properly/64251/1 "2021-05-22T19:10:16Z")

</div>

Hello, community.  
Can someone explain why the node **Element.SetParameterByName** works properly on “Case 2” and not on “Case 1”? I mean, on “Case 1” the parameter is not being set at the sequence.

If that matters, the elements are being collected from a schedule.

 ![22-05-2021](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/e/4e7e98cb25698fcc5b353a3067ae586eed06f29e.png)

---

<div class="post-metadata">

**Author:** ![truevis](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/truevis/32/8634_2.png) [@truevis](https://forum.dynamobim.com/u/truevis)\
**Post date:** [May 23, 2021, 7:45pm UTC](https://forum.dynamobim.com/t/node-element-setparameterbyname-not-working-properly/64251/2 "2021-05-23T19:45:04Z")

</div>

I would think it should work as expected. I’d first try freezing CASE 2, then try getting the elements in a more old-fashioned way – not from a Schedule.

---

<div class="post-metadata">

**Author:** ![Guilherme](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/guilherme/32/78546_2.png) [@Guilherme](https://forum.dynamobim.com/u/Guilherme)\
**Post date:** [May 23, 2021, 8:44pm UTC](https://forum.dynamobim.com/t/node-element-setparameterbyname-not-working-properly/64251/3 "2021-05-23T20:44:52Z")

</div>

I’ve add both cases just to show how the node isn’t working as expected.

> [@truevis](#):
>
> I’d first try freezing CASE 2, then try getting the elements in a more old-fashioned way – not from a Schedule.

I’ve tried your suggestion and unfortunately it has no effect. If I create manually a list of “1, 2, 3, …, X” and apply that, it works, but it doesn’t if I apply the sequence produced by **List.Count**. I have also tried both Text and Number types of parameter.

---

<div class="post-metadata">

**Author:** ![truevis](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/truevis/32/8634_2.png) [@truevis](https://forum.dynamobim.com/u/truevis)\
**Post date:** [May 24, 2021, 7:52am UTC](https://forum.dynamobim.com/t/node-element-setparameterbyname-not-working-properly/64251/4 "2021-05-24T07:52:37Z")

</div>

> [@Guilherme](#):
>
> I’ve tried your suggestion and unfortunately it has no effect. If I create manually a list of “1, 2, 3, …, X” and apply that, it works, but it doesn’t if I apply the sequence produced by **List.Count**. I have also tried both Text and Number types of parameter.

Even if you get the elements with **All Elements of Category** instead of via a Schedule?

---

<div class="post-metadata">

**Author:** ![Guilherme](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/guilherme/32/78546_2.png) [@Guilherme](https://forum.dynamobim.com/u/Guilherme)\
**Post date:** [May 24, 2021, 6:17pm UTC](https://forum.dynamobim.com/t/node-element-setparameterbyname-not-working-properly/64251/5 "2021-05-24T18:17:02Z")

</div>

Yes, even so. Apparently the problem is the node.

---

<div class="post-metadata">

**Author:** ![truevis](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/truevis/32/8634_2.png) [@truevis](https://forum.dynamobim.com/u/truevis)\
**Post date:** [May 24, 2021, 6:30pm UTC](https://forum.dynamobim.com/t/node-element-setparameterbyname-not-working-properly/64251/6 "2021-05-24T18:30:41Z")

</div>

Maybe try a Sort By Key in there, somewhere???

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [May 24, 2021, 6:54pm UTC](https://forum.dynamobim.com/t/node-element-setparameterbyname-not-working-properly/64251/7 "2021-05-24T18:54:33Z")

</div>

It looks like those are family instances, but can you confirm that? It could be that you have multiple of the same types in your list so you’re rewriting values down the list. Or that you just have multiple of the same instance.

---

<div class="post-metadata">

**Author:** ![Guilherme](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/guilherme/32/78546_2.png) [@Guilherme](https://forum.dynamobim.com/u/Guilherme)\
**Post date:** [May 25, 2021, 7:06pm UTC](https://forum.dynamobim.com/t/node-element-setparameterbyname-not-working-properly/64251/8 "2021-05-25T19:06:14Z")

</div>

> [@truevis](#):
>
> Maybe try a Sort By Key in there, somewhere???

They are already in the order that I need, actually. So…

> [@Nick\_Boyts](#):
>
> It looks like those are family instances, but can you confirm that?

Yes and multiple families have the same family instance name. I have ordered them (alphabetically) by a parameter. What can I do?

---

<div class="post-metadata">

**Author:** ![truevis](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/truevis/32/8634_2.png) [@truevis](https://forum.dynamobim.com/u/truevis)\
**Post date:** [May 25, 2021, 7:30pm UTC](https://forum.dynamobim.com/t/node-element-setparameterbyname-not-working-properly/64251/9 "2021-05-25T19:30:07Z")

</div>

> [@Guilherme](#):
>
> Yes and multiple families have the same family instance name. I have ordered them (alphabetically) by a parameter. What can I do?

How about handling them via IDs (which will be unique), with **Sort By Key** s?

---

<div class="post-metadata">

**Author:** ![Guilherme](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/guilherme/32/78546_2.png) [@Guilherme](https://forum.dynamobim.com/u/Guilherme)\
**Post date:** [May 25, 2021, 8:02pm UTC](https://forum.dynamobim.com/t/node-element-setparameterbyname-not-working-properly/64251/10 "2021-05-25T20:02:45Z")

</div>

I have found the problem. @Nick_Boyts was right: some instances were duplicated.

Thank you to both.
