How do I define a family parameter in RevitAPI 2023 using python block in DesignScript?

On image lower I define a family parameter (not shared). How do I do this operation in python DS block in RevitAPI 2023?

I tried several variations of the following, but I struggle to find the correct combination of parameters or not even know which is the correct overloaded version of the AddParameter function, or even if it is how it is done. I managed to define parameter that takes another family as it’s value, but not text or numeric values.

familyDoc.FamilyManager.AddParameter("Parameter Name", ForgeTypeId("Text"), SpecTypeId.Custom, True)

I think this looks like what you need. Uses Crumple, but you can dissect @GavinCrump custom nodes as needed.

Additional information here from the API docs.

1 Like

To add to sean currently ive only built for the non forgetype method, generally still catching up to the unplications of this when it comes to parameters and bindings.

The 2023 method looks quite simple, it takes a definition (which crumple outputs using the SharedParameters.Flat node), then I believe you can pass the group type string (PG_DATA etc.) to the ForgeTypeId constructor for the second argument. I’ve done this for builtinparmeter enums lately and it worked for those:

1 Like

Thanks y’all for your repsonses and my mistake. I figured we started to move on to the next version - Revit 2024 and there seems to be a big difference in how this stuff is done. So I wonder also how to create Family type parameter in the Revit 2024? There seems to be some changes there.