Hi Dale,
Hope you had a great weekend! For example, I create a list of shared parameters to be added to a family in the family manager by doing this:
// Prior to Revit 2024
public class MySharedParameter
{
#if REVIT2018 || REVIT2019 || REVIT2020 || REVIT2021 || REVIT2022 || REVIT2023
public string Name;
public BuiltInParameterGroup Group;
public bool IsInstance;
public MySharedParameter(string parameterName, BuiltInParameterGroup parameterGroup, bool isInstance)
{
Name = parameterName;
Group = parameterGroup;
IsInstance = isInstance;
}
// In Revit 2024
#elif REVIT2024
public string Name;
public ForgeTypeId Group;
public bool IsInstance;
public MySharedParameter(string parameterName, ForgeTypeId parameterGroup, bool isInstance)
{
Name = parameterName;
Group = parameterGroup;
IsInstance = isInstance;
}
#endif
}
// create a list of parameters to be added in Revit 2023
parameterList.Add(new MySharedParameter("Cable1", BuiltInParameterGroup.PG_DATA, true));
parameterList.Add(new MySharedParameter("Cable2", BuiltInParameterGroup.PG_DATA, true));
// in Revit 2024, it becomes:
parameterList.Add(new MySharedParameter("Cable1", GroupTypeId.IdentityData, true));
parameterList.Add(new MySharedParameter("Cable2", GroupTypeId.IdentityData, true));
// The actual line adding the shared parameters to family (no change in this line because the data type in my shared parameter list actually changed, I need to simplify the whole thing).
famMan.AddParameter(ed, parameterToBeAdded.Group, parameterToBeAdded.IsInstance);
Hope that makes sense.
Kevin