Relate Mark and other parameter with Element.SetParameterByName


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.

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

after you send 5 parameter values for 12 elements

Cordially
christian.stan

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

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

Cordially
christian.stan