Element.SetParameterByName error from Excel to Revit

Hi everybody
This is my first post. Hope you can help me.
i’ve been reading similar topics but didnt find de solution.
i’m trying to write in excel (no problem with this) and read from excel to set type parameters of walls and i get this error:
**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)'
Can you help me?

Hi @AlcArq

Could you upload the screenshot again. Its not readable.

Are you trying to write values to 28 wall types?

Just a guess, but try using an object.type node to find out what the null is. Remember that Revit wants a string here, so anything other than that won’t work. I haven’t check what a null is out of the excel node before. If you want a string with nothing in it, use an empty string node, and you can try to replace the nulls with an empty string and see if that helps.

Also you should try using just the unique element types using the list.unique node, as those duplicate types could have multiple values in excel while Revit can only take one value as you are dealing with element types.

Why use WallType.Name and WallName.ByType?

1 Like

Yes. I’m trying to write to all instances of wall.
I dont know how to list only types of wall to write type parameter to each type

The idea is getting on one hand type parameter, and on the other hand instance parameters.
I dont know other way to do it
I need to combine type parameters with instance parameter in a shhet in excel, work in that sheet, and back to revit

When getting started with something like this, it is advisable to be like water and take the path of least resistance. Eventually you can carve the Grand Canyon, but first maybe start by traveling in that little gully.

In this case, I think that means to do them as separate excel sheets. Write the type parameters from the types sheet. Write the instance parameters from the instance sheet (which can also show the type parameters for reference).

1 Like

Think you’re right.
I’m tryin’ to do as separate and then i get this error:
Warning: Internal Error, Report: Reference to a non-pointer is being null
What i’m trying to do is take the values of parameter “Model” from excel and write to parameter “Type Mark”
Any idea??

And other question…
Can i write the data in the Name of the type??
Which is the name of the parameter?

The issue appears to be that you are trying to set a parameter value for the names of the types. Try removing the WallTypeName node and going straight from the wall types to the Element.SetParameterByName node.

Side note: can someone look into blocking .name based auto hyperlinks as it’s too common for nodes and I really don’t want someone to get some random digital plague on their system because of an oversight.

Thanks Jacob!!!
It’s working
But can you help me again
If i would like to use Element.SetParameterByName node to change the name of each type (WallType.Name), which is the name of the parameter to use??
Thanks again