Message 1 of 3
ParameterType and BuiltInParameterGroup enums are obsolete in recent Revit versions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I have a chunck of code to create a project parameter based on this Dynamo node.
But now I noticed that the below code snippet won't work on Revit API 2022 and above:
var parameterType = ParameterType.Text;
if (!System.Enum.TryParse(type, out parameterType))
throw new System.Exception("Parameter not found");
// parse parameter group
var parameterGroup = BuiltInParameterGroup.PG_DATA;
if (!System.Enum.TryParse(group, out parameterGroup))
throw new System.Exception("Parameter not found");
If I move to Revit 2022/2023 API I get this warning/error respectively:
'ParameterType' is obsolete: 'This enumeration is deprecated in Revit 2022 and may be removed in a future version of Revit. Please use the `ForgeTypeId` class instead. Use properties of the `SpecTypeId` class and its nested classes to replace uses of specific values of this enumeration.'
And if I move to Revit 2024/2025 API I get this warning/error respectively:
'BuiltInParameterGroup' is obsolete: 'This enumeration is deprecated in Revit 2024 and may be removed in a future version of Revit. Please use members of the `GroupTypeId` class instead.'
I tried to use ChatGPT and other methods on the web to resolve these issues but to no avail so far. Tried to use SpecTypeId and GroupTypeId but nothing is working for me.
Can someone please assist?