Script for Duct and fittings family type changing

I want to change the family type of my duct and fittings in the whole model
plz can someone help me?

What do you have so far???