Error in script that attempts to create internal elevations

Hi all,

I found a script on youtube I want to try out and seem to get this error within the node Element.setparametreByName shown in the photos.

The script is supposed to create internal elevations of each side of a room, so I select multiple rooms and then let it do its thing. Its an old video so thought id get a better response for help here.
Thanks


Try a Transaction.End and Transaction.Start node between the creation of the elevations and the parameter on the element.