Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

BuiltInParameterGroup - how to get only values shown in UI

8 REPLIES 8
Reply
Message 1 of 9
boostyourbim
2555 Views, 8 Replies

BuiltInParameterGroup - how to get only values shown in UI

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?

8 REPLIES 8
Message 2 of 9
jeremytammik
in reply to: boostyourbim

Dear Harry,

 

Checking with the development team for you...

 

Cheers, 

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 9
Scott_Wilson
in reply to: boostyourbim

If it turns out to not be available as an API feature i would create a static class called something like UIParameterGroup thatcontains only the 44 enum values that you mention as static properties. You can then use it with similar syntax as the original enumeration.
Message 4 of 9
jeremytammik
in reply to: boostyourbim

The development team are discussing how this could be exposed in the API...

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 5 of 9
jeremytammik
in reply to: boostyourbim

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?



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 6 of 9
boostyourbim
in reply to: jeremytammik

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);

Message 7 of 9
jeremytammik
in reply to: boostyourbim

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



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 8 of 9
m.vallee
in reply to: jeremytammik

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

Message 9 of 9
misharevea
in reply to: boostyourbim

Perhaps this is a very good decision at the moment! Thank you for your idea!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community