Change Family type of a list of pipe fittings-Error

Hi all I would like to change generic elbow families at once to welded.

I have writen a code as shown below.

Its giving me an error related to ChangeTypeId method.Can somebody help?
Testing.dyn (8.3 KB)

This is the method I am trying to implement.