Shared Parameter Group

Shared Parameter Group

Anonymous
Not applicable
1,862 Views
4 Replies
Message 1 of 5

Shared Parameter Group

Anonymous
Not applicable

I am looking to get all shared parameters from a certain group; for instance all the parameters that are part of the Wall Parameters group.SharedParameters.PNG

I currently have the shared parameters read, and can read the property for the name.  I don't see any property that relates to the group, or group name. I am using the LookUp and exploring the database, specifically the shared parameter elements. Even looking there, I can't seem to track down the Group that the parameter is in. Is this possible to obtain?

0 Likes
Accepted solutions (1)
1,863 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable

The parameter group is in the definition. For example:

 

if (p.Definition.ParameterGroup == BuiltInParameterGroup.PG_GEOMETRY) 
0 Likes
Message 3 of 5

Anonymous
Not applicable

Thanks, but that gives me the BuiltInGroup that the parameter is assigned to on the category level, not the Shared Parameter Group.

0 Likes
Message 4 of 5

FAIR59
Advisor
Advisor
Accepted solution

You are looking for the organisation of the shared parameterfile. This code gets all the definitions for a ParameterDefinitionGroup.

 

                DefinitionFile FParamFile =  doc.Application.OpenSharedParameterFile();
                DefinitionGroup FParamGroup = null;
                string SearchName = "Wall Parameters";
                using (IEnumerator<DefinitionGroup> enumerator = FParamFile.Groups.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        DefinitionGroup current = enumerator.Current;
                        if (current.Name ==  SearchName) FParamGroup = current;
                    }
                }
                Definitions paramDefs = FParamGroup.Definitions;
Message 5 of 5

Anonymous
Not applicable

Thank you.  This is what I was looking for.

0 Likes