# Relate Mark and other parameter with Element.SetParameterByName

**URL:** <https://forum.dynamobim.com/t/relate-mark-and-other-parameter-with-element-setparameterbyname/88771>\
**Category:** Revit\
**Tags:** revit, excel, python, geometry, dynamo\
**Created:** [April 20, 2023, 11:34am UTC](https://forum.dynamobim.com/t/relate-mark-and-other-parameter-with-element-setparameterbyname/88771 "2023-04-20T11:34:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![manuel.monteroH2Y3P](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@manuel.monteroH2Y3P](https://forum.dynamobim.com/u/manuel.monteroH2Y3P)\
**Post date:** [April 20, 2023, 11:34am UTC](https://forum.dynamobim.com/t/relate-mark-and-other-parameter-with-element-setparameterbyname/88771/1 "2023-04-20T11:34:58Z")

</div>

![ING-STR-Zapatas Excel a Revit-Modificado_2023-04-20_01-28-42](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/c/bc0bdabbb39cab9f23c650b7e086101dfae99af4.png)  
Hi there,

I trying to import some data from a Excel file in order to modify the structural foundation dimensions when mark values matches with the results of the python script.

I also leave the script in case you see an error:

# Importa los módulos necesarios

import clr  
clr.AddReference(‘RevitAPI’)  
from Autodesk.Revit.DB import \*  
from System.Collections.Generic import \*

# Definir la función que busca el valor de la entrada 3

def buscar\_valor(valores\_1, valores\_2, valores\_3):  
salida = 0  
for i, v1 in enumerate(valores\_1):  
for j, v2 in enumerate(valores\_2):  
if set(zip(v1, v2)) == set(zip(valores\_1[j], valores\_2[j])):  
nivel = sorted(range(len(valores\_2[j])), key=lambda k: valores\_2[j][k])  
salida = [valores\_3[i][nivel[k]] for k in nivel]  
break  
if salida != 0:  
break  
return salida

# Obtener las entradas del nodo

valores\_1 = IN[0]  
valores\_2 = IN[1]  
valores\_3 = IN[2]

# Ejecutar la función para buscar el valor correspondiente

salida = buscar\_valor(valores\_1, valores\_2, valores\_3)

# Enviar la salida del nodo

OUT = salida

Any help would be really appreciated. Thanks.

---

<div class="post-metadata">

**Author:** ![christian.stan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/christian.stan/32/166296_2.png) [@christian.stan](https://forum.dynamobim.com/u/christian.stan)\
**Post date:** [April 20, 2023, 1:18pm UTC](https://forum.dynamobim.com/t/relate-mark-and-other-parameter-with-element-setparameterbyname/88771/2 "2023-04-20T13:18:50Z")

</div>

Hello,  
you feed (Text strings instead of your elements)

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/4/54379ab52233170f9fc0463590ecd8f9abdaa0b2.png)

after you send 5 parameter values for 12 elements

Cordially  
christian.stan

---

<div class="post-metadata">

**Author:** ![manuel.monteroH2Y3P](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@manuel.monteroH2Y3P](https://forum.dynamobim.com/u/manuel.monteroH2Y3P)\
**Post date:** [April 20, 2023, 1:30pm UTC](https://forum.dynamobim.com/t/relate-mark-and-other-parameter-with-element-setparameterbyname/88771/3 "2023-04-20T13:30:37Z")

</div>

Thanks for the reply but still doesn’t work.

I get the next message:  
Warning: Element.SetParameterByName operation failed.  
The parameter’s storage type is not a string

---

<div class="post-metadata">

**Author:** ![christian.stan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/christian.stan/32/166296_2.png) [@christian.stan](https://forum.dynamobim.com/u/christian.stan)\
**Post date:** [April 20, 2023, 1:34pm UTC](https://forum.dynamobim.com/t/relate-mark-and-other-parameter-with-element-setparameterbyname/88771/4 "2023-04-20T13:34:19Z")

</div>

so now you need to know the properties of your parameter  
(the error message helps you, it tells you those are not strings)  
edit:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/6/a60d07015a118e352dc9eea87b7b59421112557e.png)

Cordially  
christian.stan
