Warning in SetParameterByName

Might be a basic mistake, but I can’t figure it out. :sweat_smile: I’ve created a small script that filters through lighting fixtures and their host. If they are hosted on a ceiling, a string is copies to “comments”, if it’s hosted on a floor (no suspended ceiling), a different string is copied.

The script works just fine, but when executing, “Element.SetParameterByName” shows a “warning” with “Elements.SetParameterByName expects argument type(s) (Revit.Elements.Element, string, var), but was called with (string, string, string).”

Is there any way to “clean” this warning?

Thanks in advance.

PS: The “List.UniqueItems” was included later to test things out, but works fine without it.

You can try like this,

Host.dyn (21.4 KB)

1 Like

This is indicating that the first input is somehow a string instead of an element. Can you use an Object.Type node after the List.FilterByBoolMask followed by a List.UniqueItems to confirm everything is a type of Revit Element. This will have to happen for both the ‘in’ and ‘out’ outputs from the List.FilterbyBoolMask node.

One possible reason things might be going a bit sideways is elements might not have a parameter for “Plano de trabajo”.

1 Like

I don’t know why passing both values in one single Codeblock rather than one for each fixes the warning, but it did :sweat_smile:

Thanks to both!