Revit AddParameter method is not working on 2023 version

Hello,

I have been working on Revit 2020 version and my python program which is adding new family type parameter worked fine.
However, on Revit 2023, the program dose not work.
My code is here;
‘’’
material_param =
family_doc.FamilyManager.AddParameter(“material_name”, DB.BuiltInParameterGroup.PG_MATERIALS, DB.ParameterType.Material, False)
‘’’
The reference on Revit API page is;
‘’’
AddParameter Method (String, BuiltInParameterGroup, Category, Boolean)
‘’’

If anyone can gave me any advise, I would appreciate.

Thank you

Kato

Hi F Kata, That method is still valid and everything looks OK in the Component version. What error are you getting?

Hi Japhy,

Thank you for your quick reply.

I created code that based on this method;
AddParameter Method (String, BuiltInParameterGroup, ParameterType, Boolean)

and this is the error message;
Runtime error (MissingMemberException): ‘Autodesk.Revit.DB’ object has no attribute ‘ParameterType’

What I need to do is to attach family parameter to family instance which is saved as .rfa file.
Now I am trying to use this method;
AddParameter Method (String, ForgeTypeId, ForgeTypeId, Boolean)

“ForgeTypeId” argument looked quite obscure but I need to understand how it works.

Thank you

Kato