Set parameter by name doesn't work on instance parameters

Hi everyone, I’ trying to compile parameters from an excel file.
I’ve obtained two lists from the sheet, one with the parameters names, and one with the parameters values.
When i try to use Element.SetParameterByName I see that It works only for the type parameters, and gives me error for the instance ones, that actually are the ones I want to modify trough excel.
Is there any solution? Do I have to use a different type of node?
Be nice, I’m not an expert!


the warning says that It can’t found any parameter with the given name, but I see that It can do that for the type parameters, and not for the instance

While working with text parameters (parameters with text as values), and when it is instance, then the values wont really update as given. we need to remove the existing values that appear in the list box at the instance parameter value area in properties box. let me try fixing this if you can give a rough version of your file.

@gideonkarthik The problem is that the aim of this file is to have the chance to update parameters values directly form the excel file, without modifying them in revit, i don’t understand if you say that i should have an empty parameter to let the algorithm work, if yes, in this way it’s not what i want
I give now you my file, thank you for now!
Da Excel a Revit.dyn (43.6 KB)
(You can see the instance values are “_Codice”, “_Edificio”, “_Livello”, “_Locale” etc…)

PS. Reading the two lists, the first two terms, 0 and 1, are not parameters that i want to modify, but i didn’t found a way to put them out of the list, i didn’t consider it a problem 'cause the parameter “3.2.1.A.A.1” doesn’t exist and I won’t modify “Tipo”'s value

you are not feeding elements but a floor type. if you want to set the instance parameters, get all the floors first and filter out the specific floortype.

@l.dorrestijn Thank you, I actually thought that that could be the problem, but the floor belongs to a system family and i didn’t find a way to select it differently, do you have any advice?
I’ve tried this before, but in this case setparameterbyname didn’t find anything


this could be a solution

1 Like

@Marcel_Rijsmus I didn’t link the filter with that node but with the list i created, i’ll try in this way but i don’t know if that’s the problem 'cause the filter works

I would also skip the List.Create node

@Marcel_Rijsmus @l.dorrestijn By using your advices i now can modify instance parameters, so thank you!
Now i can’t modify type parameters but i’ll easily copy the algorithm by using the type as element and i’ll do the two things separately, 'cause i can’t link two elements to the node
I’ll upload the algorithm in case this could be useful for someone else!

2 Likes