Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
My question is very similar to this post but could not solve my problem.
To add material parameter as family type parameter, here is my python code for Revit2020;
material_param = family_doc.FamilyManager.AddParameter("material_name",DB.BuiltInParameterGroup.PG_MATERIALS, DB.ParameterType.Material, False)
And I arranged it for 2023 but error occurs is this;
materialgroupTypeId = GroupTypeId.Materials
familyCategory= Category.GetBuiltInCategoryTypeId(BuiltInCategory.OST_Materials)
material_param = fam_doc.FamilyManager.AddParameter("material_name_string", materialgroupTypeId, familyCategory, False)
The error message came out when the code run is this;
Runtime error (ArgumentException): Not a spec
Parameter name: specTypeId
I created it based on the method
AddParameter(String, BuiltInParameterGroup, Category, Boolean)
however, should I be using
AddParameter(String, ForgeTypeId, ForgeTypeId, Boolean)
instead?
Would anyone be able to offer some advice?
Kato
Solved! Go to Solution.