Seting parameter value by name

Hey guys,

I am trying to set parameter value by name after filtering the selection but I get this error saying

“Warning: Element.SetParameterByName expects argument type(s) (Element, string, var), but was called with (double, string, int).”.

Can anyone clarify what is the reason?

Thank you!

You have to connect the elements into the “element” input on the SetParameter node. Right now you are feeding it a string.

@SeanP
I also think that he has to separate out the correct 42 elements out of the 72 he starts with.
Maybe you can show how, i don’t have dynamo at home

Exactly, Mr. Marcel got the point.

By connecting it the way you suggested (Sean1) it will set parameters for all the selected model elements, but I have seperated 42 out of 72 which I want to change parameter for. The remaining ones shall not change.

Any other ideas?

you need a filter node to get to the 42
try filter by boolean mask

use the search button in the top right of this screen, there are loads of examples

1 Like

Wire the Element.GetParameterValueByName node into the X input of the == node, then set the code block into the Y input. Take the resulting booleans and feed them in to the mask input of a List.FilterByBoolMask node, and the list of elements in as the list. The ‘in’ value goes into the Element input of the Element.SetParameterValueByName node. The other inputs for that node should remain unchanged.

1 Like

Thank you guys for contribution, I have tried the boolmask filter and still the same issue appear

You’re close. Instead of filtering the parameter values, you need to filter the Element list. The warning at the element.setparametervaluebyname node should give you some indication in the future.

1 Like

Thank you a lot Mr. Jacob, you’re the savior !