Excel write to Revit using UniqueId: error message

Hello to all,
I am a newbie to Dynamo and this is my second graph. I’ve tried to write values from a previous excel table to revit using the UniqueId as an identification index.


I’m receiving the following message in the last node:
“_Warning: Element.SetParameterByName operation failed. _
The call is ambiguous between the following methods or properties: ‘Revit.Elements.InternalUtilities.ElementUtils.SetParameterValue(Autodesk.Revit.DB.Parameter, Revit.Elements.Element)’ and ‘Revit.Elements.InternalUtilities.ElementUtils.SetParameterValue(Autodesk.Revit.DB.Parameter, string)’
Moreover, most of the values are transcripted, but 3 of them are not written at all, as it can be seen in the comparison between the two tables.
Input to Revit:
https://drive.google.com/file/d/165DJivzR7trTkvg5SdwBJwa2UFDt_Eno/view?usp=sharing

Data written ion Revit:
https://drive.google.com/file/d/1l2D6RzZc0lQBdEF9JRSfgmDaYYnLr54K/view?usp=sharing

I am very confused. Do somene ould explain to me what is going wrong?
Thanks in advance

No one could help?:confused:

Firstly when you are setting up graphs like this it is much nicer to use a smaller workset to assure that it works before you move to try it on a mass of elements/values etc. Identifying the error is simply much harder.

It seems that there somewhere in your “values” are a element or something like that, could you in addition throw in a watch node on the elements which you’re feeding the setparamaterbyname node?

1 Like

Hello Jonathan,
thanks for your reply!
I’ll chek it, but later. I have a reunion about to begin.
I’ll keep you informed
till later,

luciana

Hello Jonathan,
I was diverted to another project during the last 2 weeks, so I’m resuming just now dynamo’s activities.

_

“It seems that there somewhere in your “values” are a element or something like that, could you in addition throw in a watch node on the elements which you’re feeding the setparamaterbyname node”

_

Do you mean a watch node between ElementSelector.ByUniqueId" and “Element.SetParamaterByName”? It didn’t return anything different from the output of “Element.SetParamaterByName”, as you can see in the image below:

As you can see in the table below, most of my elements had their values filled correctly, that means, 30 over 509. The model is a very small, but representative fraction of a bigger facility. The elements were imported from IFC into Revit, where I added more parameters. Some families were copied to fill some spaces, but I see no relation between the copies and the missing information.
Those are the “problematic” elements:

I’d be willing to give it a go, but I’d need the Excel, Dynamo and Revit files to properly test :slight_smile: Let me know if these are files that you’re allowed to share.

Hello Jonathan,
of course, there is nothing confidential about it, as they are still some kind of simulation files. I would be extremely thankful for your help, as I’m doing a lot of research and don’t manage to find out what could be wrong.
I’ve sent you a link to download via private message, but is not a problem to communicate in the forum.

Thanks a lot!

Okay, I’ve had a look and found your issue…

You have “blank” values in your excel files, this will return “null” values in your dynamo graphs, you cannot write “null” to a parameter, if you use the node “Manage.ReplaceNulls” and replace with an empty string (codeblock with “” as content) it will solve your issue :slight_smile:

(Your content “2017” “2018” is read by dynamo as strings) :slight_smile: (Found this using a combination of “Object.Type” and “List.UniqueItems”) :slight_smile:

1 Like

Hi Jonathan!
thanks for your help. The error message disappeared and I think “Manage.ReplaceNulls” will be extremely useful in a very near future :grinning:!
But, as still the same elements are coming with empty fields, I’ve checked the result again and figured out that the problem may lay in another part of the code: ElementSelector.ByUniqueId.
In fact I just realized that the element on position “0” which has a GUID “cbed8b51-15c7-4bd9-ad80-517507fea0ac-0001fc9c” should have been a “Barra Innesto” and not a “Plinto 330x330”. It seems that the node is mixing some information…
I’ll do some other checking to understand if the original problem lays on the excel table… :thinking:
I thank you a lot for all the help you’ve gave to me!
I will also mark as solved because you did solve one big problem :slightly_smiling_face:!

1 Like