Import Excel, Element.setParameterByName Error

Hello everyone!

I’m new in dynamo and need a little bit of help please.
I need to export and import the parameter values of all elements of my Revit model (rooms, walls, floors, ceiling, doors, windows …) in the way that we can put the values of each parameter in the excel and import it easily in the revit model. The export works fine but I’ve got troubles with the import at the node Element.SetParameterByName. I searched in here and in the internet for a long time but didn’t find the solution of the errors that are showing on my dynamo.

I downloaded a picture of my room dynamo.
The errors that are on ‘Element.SetParameterByName’ on my room dynamo are:

  • ERROR 1 - appears on almost all of my ifc shared parameters
    “Le type de stockage du paramètre n’est pas une chaîne” (= which would be in english: the type of storage of the parameter is not a chain).

  • ERROR 2 - appears on the parameter “Surface” (=area)
    "Avertissement:Element.SetParameterByName l’opération a Èchoué.
    L’appel est ambigu entre les méthodes ou propriétés suivantes : ‘Revit.Elements.InternalUtilities.ElementUtils.SetParameterValue(Autodesk.Revit.DB.Parameter, Revit.Elements.Element)’ et Revit.Elements.InternalUtilities.ElementUtils.SetParameterValue(Autodesk.Revit.DB.Parameter, string)’ "
    (= which would be in English : operation failed,. The call is ambigious between the folowing methodes and properties: ‘Revit.Elements.InternalUtilities.ElementUtils.SetParameterValue(Autodesk.Revit.DB.Parameter, Revit.Elements.Element)’ et Revit.Elements.InternalUtilities.ElementUtils.SetParameterValue(Autodesk.Revit.DB.Parameter, string)’)

Does anyone know what I am missing?

I would really appreciate some help :slight_smile: !

Here an other screenshot :slight_smile:

First of, your graph is not neat and hard to read. It is understandable that you wanna set multiple parameter values to multiple parameter and you can do that by utilising the lacing and levels of a node. You can get back the parameter and element value by exporting their key value, for example their ids.

Secondly, the error is due to either having null in your value or the object type is not set proper to the parameter storage type.

Hi stillgotme,
thank you very much for this quick answer!
Unfortunately I don’t really understand what you mean. What is the “lacing” and the “levels” of a node?

Example for Lacing : https://dictionary.dynamobim.com/#/Core/List/Action/List.LaceShortest

Basically, it helps running a function while matching indexes (1 with 1, 2 with 2, etc.)

And by levels, he means the little drop box “@” on the nodes but you might no having it depending the version of Dynamo you’re running.

Thank you TomK, I’m checking the lacing.
But does it mean that all my chain is wrong for what I need to do? (export the values from Revit to Excel, change or ad the values in excel, Import the new values from excel to Revit) Or do I have to ad the list and attach it to something?

I think I do have the levels, see attached screenshot.

I think the orginal comments was more like “dont duplicate chains of nodes, make lists of inputs then feed these to one chain of nodes”

ah ok, I will try that, thanks!

The first error is probably ‘the storagetype of the parameter is not a string’. That means you’re trying to feed a string into the parameter when you should actually be inputting something else (like an element maybe).

Check this post: Copy a number value from one paramter to another

Perhaps consider changing your language settings to english, it might be easier to look for an answer on the web. Not obligatory of course, just a suggestion.

1 Like

Hi Danos, yes thats my Error. I also thought that this is the problem. The parameter “Illuminance” for exemple is a Number parameter (see screenshot below), so I tried to put an Number node instead of the Code block, but the error is still there and the changes I did in the excel dont charge in the revit.
Maybe I need to give the information that the value of the parameter is a number or yes/no somewhere else of my dynamo? Because its true that this error appears mostly on ifc shared parameters with Number or yes/no type parameters. The Text type parameters work.

Thanks so much already for all your answers!

Well then it sounds like you need to put in a string to number node before you input your value
image