Shared Parameter Type in revit 2023

Do you see any errors you can share? Between Revit 2022 and 2023, the only change I know which can impact this workflow is the transition from ParameterType to ForgeTypeId.

Make sure that the active shared parameter file in Revit actually exists and is accessible, and it does not already have some of the parameters, and it has the parameter groups you assigned.

You can see this post for reference: Batch export shared parameters - #4 by cgartland

When switching to ForgeTypeId, it looks like this:


p_names = ["p1","p2"]
p_guids = ["fa64ce9f-8e19-4623-874c-1b6520e55821","e8d9d570-52dd-4e75-ba8d-ddf84f050f3c"]
p_types = [ForgeTypeId("autodesk.spec:spec.string-2.0.0"),ForgeTypeId("autodesk.spec.aec:length-2.0.0")]
g_names = ["gg1","gg2"]

definition_file = app.OpenSharedParameterFile()
definition_groups = definition_file.Groups

for p_name, p_guid, p_type,g_name in zip(p_names, p_guids, p_types,g_names):
	for group in definition_groups:
		if group.Name == g_name:
			ops = ExternalDefinitionCreationOptions(p_name, p_type)
			# Construct a Guid from a string
			ops.GUID = System.Guid(p_guid)
			a = group.Definitions.Create(ops)