How to retrieve a FamilyParameter's group name?

How to retrieve a FamilyParameter's group name?

Anonymous
Not applicable
1,491 Views
3 Replies
Message 1 of 4

How to retrieve a FamilyParameter's group name?

Anonymous
Not applicable

How to retrieve a FamilyParameter's group name? I tried it with InternalDefinition.BuiltInParameter.ToString() but I end up with not very user-friendly names, and some groups have "INVALID" value there (e.g. group "Other"). Anyone can help?

0 Likes
Accepted solutions (1)
1,492 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

Dear Krug,

 _elm is Family instance of your family.

 

// This is for Instance Parameter
ParameterSet ps = _elm.Parameters;
foreach (Parameter p in ps)
{

     p.Definition.Name;
     p.Definition.ParameterType ;
     p.Definition.ParameterGroup;
     _elm.Category.Name;
      p.StorageType;

}

// For Type Parameter
Element elmTmp = _elm.Document.GetElement(_elm.GetTypeId());
if (elmTmp != null)
{
ParameterSet psType = elmTmp.Parameters;
foreach (Parameter p in psType)
{

  p.Definition.Name;
  p.Definition.ParameterType ;
  p.Definition.ParameterGroup;
  _elm.Category.Name;
 p.IsReadOnly;
  p.StorageType;

}
}

 

i hope this will help you.

0 Likes
Message 3 of 4

Revitalizer
Advisor
Advisor
Accepted solution

LabelUtils.GetLabelFor(p.Definition.ParameterGroup)




Rudolf Honke
Software Developer
Mensch und Maschine





Message 4 of 4

Anonymous
Not applicable
Thanks Revitalizer,

Yes i forgot to written this

LabelUtils.GetLabelFor(p.Definition.ParameterGroup) for user viewable name.