Element.SetParameterByName could not find the paremeter, and yet it does

Hi everyone, I’ve been running a simple script to fill some custom “instance parameters”. The script works just fine, it does what I expect it to do, but with a warning on “Element.SetParameterByName” saying it could not find any parameter by that name. And yet, it does find the parameter and fill it with the string I feed it.

If the script stopped at that point and did not fill the parameter I would assume it was a problem with the parameter name as the warning mentions but… I really don’t know where the problem is and even though the script works as intended, I would like to avoid future surprises because of this.

The warning is in spanish, but probably get the idea.

Thanks in advance.

Really hard to tell with any of the preview bubbles pinned.

PS
Why do you ungroup your Groups?
Why not use this setting for that Parameter?

image

Also i feel you overcomplicated your script.

Lastly
A tip; With DesignScript you can make your graphs a lot cleaner :sweat_smile:

EDIT
@cchulia

1 Like

You’d think I would have thought of that rather than overcomplicating things :see_no_evil_monkey:

Honestly, I didn’t even consider that, I was tinkering with nodes to see how they worked and didn’t go with the simple solution.

The script is much smaller now, yet the problem persist.

PS: DesignScript is something I have to look into.

Might be your List length.

But there is no need to do this anyways :backhand_index_pointing_up:.

Are you 100% sure all the Group.Members have that Parameter?

Also pay attention to stuff like this :backhand_index_pointing_down:.
(@cchulia I think this causes the error)

Would help if you post your graph with the preview bubbles pinned.

1 Like

That was in fact the problem. Running the script to create a screenshot with bubbles pinned to upload, I saw the “SketchPlane” elements in fact output as null, and testing the script on a clean project with groups walls would show no warnings.

Mistery solved, thanks very much. I should’ve check those elements.