There are 108 values defined for this enum in the API.
However, there are only 44 options for "Group Parameter Under" in the Parameter Properties dialog when adding or modifying a Project Parameter.
So there are 64 BuiltInParameterGroup values that appear to be "internal" or that do not apply when selecting a group for a parameter.
How with the API can we get only the 44 valid Parameter Group values?
Dear Harry,
Checking with the development team for you...
Cheers,
Jeremy
The development team are discussing how this could be exposed in the API...
Cheers,
Jeremy
The development team discussions led to a suggestion:
We have this:
void CRSAPI getUserAssignableParamGroups(ElementIdArr &arr);
Ha! Which is exposed:
bool Revit::DB::FamilyManager::IsUserAssignableParameterGroup( Autodesk::Revit::DB::BuiltInParameterGroup parameterGroup)
And documented:
FamilyManager.IsUserAssignableParameterGroup Method
Harry, did you try this one?
Hi Jeremy,
Thanks for the suggestion.
My code is running in a Project, not Family, so that would be a bit awkward to use. (I guess I could create a new family, run that test on all parameters, then close the temporary family). I wonder why that is in FamilyManager?
In case it might be helpful to others, here is the hard-coded list I wrote:
List<BuiltInParameterGroup> validGroups = new List<BuiltInParameterGroup>();
validGroups.Add(BuiltInParameterGroup.PG_ANALYSIS_RESULTS);
validGroups.Add(BuiltInParameterGroup.PG_ANALYTICAL_ALIGNMENT);
validGroups.Add(BuiltInParameterGroup.PG_ANALYTICAL_MODEL);
validGroups.Add(BuiltInParameterGroup.PG_CONSTRAINTS);
validGroups.Add(BuiltInParameterGroup.PG_CONSTRUCTION);
validGroups.Add(BuiltInParameterGroup.PG_DATA);
validGroups.Add(BuiltInParameterGroup.PG_GEOMETRY); // Dimensions
validGroups.Add(BuiltInParameterGroup.PG_DIVISION_GEOMETRY);
validGroups.Add(BuiltInParameterGroup.PG_AELECTRICAL);
validGroups.Add(BuiltInParameterGroup.PG_ELECTRICAL_CIRCUITING);
validGroups.Add(BuiltInParameterGroup.PG_ELECTRICAL_LIGHTING);
validGroups.Add(BuiltInParameterGroup.PG_ELECTRICAL_LOADS);
validGroups.Add(BuiltInParameterGroup.PG_ELECTRICAL);
validGroups.Add(BuiltInParameterGroup.PG_ENERGY_ANALYSIS);
validGroups.Add(BuiltInParameterGroup.PG_FIRE_PROTECTION);
validGroups.Add(BuiltInParameterGroup.PG_FORCES);
validGroups.Add(BuiltInParameterGroup.PG_GENERAL);
validGroups.Add(BuiltInParameterGroup.PG_GRAPHICS);
validGroups.Add(BuiltInParameterGroup.PG_GREEN_BUILDING);
validGroups.Add(BuiltInParameterGroup.PG_IDENTITY_DATA);
validGroups.Add(BuiltInParameterGroup.PG_IFC);
validGroups.Add(BuiltInParameterGroup.PG_REBAR_SYSTEM_LAYERS);
validGroups.Add(BuiltInParameterGroup.PG_MATERIALS);
validGroups.Add(BuiltInParameterGroup.PG_MECHANICAL);
validGroups.Add(BuiltInParameterGroup.PG_MECHANICAL_AIRFLOW);
validGroups.Add(BuiltInParameterGroup.PG_MECHANICAL_LOADS);
validGroups.Add(BuiltInParameterGroup.PG_ADSK_MODEL_PROPERTIES);
validGroups.Add(BuiltInParameterGroup.PG_MOMENTS);
validGroups.Add(BuiltInParameterGroup.INVALID); // other
validGroups.Add(BuiltInParameterGroup.PG_OVERALL_LEGEND);
validGroups.Add(BuiltInParameterGroup.PG_PHASING);
validGroups.Add(BuiltInParameterGroup.PG_LIGHT_PHOTOMETRICS);
validGroups.Add(BuiltInParameterGroup.PG_PLUMBING);
validGroups.Add(BuiltInParameterGroup.PG_PRIMARY_END);
validGroups.Add(BuiltInParameterGroup.PG_REBAR_ARRAY);
validGroups.Add(BuiltInParameterGroup.PG_RELEASES_MEMBER_FORCES);
validGroups.Add(BuiltInParameterGroup.PG_SECONDARY_END);
validGroups.Add(BuiltInParameterGroup.PG_SECONDARY_END);
validGroups.Add(BuiltInParameterGroup.PG_SEGMENTS_FITTINGS);
validGroups.Add(BuiltInParameterGroup.PG_SLAB_SHAPE_EDIT);
validGroups.Add(BuiltInParameterGroup.PG_STRUCTURAL);
validGroups.Add(BuiltInParameterGroup.PG_STRUCTURAL_ANALYSIS);
validGroups.Add(BuiltInParameterGroup.PG_TEXT);
validGroups.Add(BuiltInParameterGroup.PG_TITLE);
validGroups.Add(BuiltInParameterGroup.PG_VISIBILITY);
Dear Harry,
Just as you suggested, you could implement code to run in a family once only to autogenerate the enum for you to use elsewhere forthwith.
Cheers,
Jeremy
Hi,
Is there a way to access the valid built-in parameter groups from a project, as of today ?
Or do I have to use the same static list as Harry used ?
Thanks,
Maxime