Help: editing families propierties.[add material parameter]

Hello kind stranger,

I have created a geometry in Dynamo, and after a lot of headaches I have managed to import it as a family to revit. For this I used FamilyType.ByGeometry. This node asks for material as input.

My surprise was that when importing the family, the object not only has no material, but it has no material parameter assigned. So I have to go into edit family and add the material parameter manually. Is there any way to create a script that goes directly to edit families and add the corresponding material parameter? Did I do something wrong when creating the families with Family Type.ByGeometry?

Any help would be welcome. Thank you very much!

Here is my code to create the families (new users can only upload one image) =)