I have configured categories in GSA for all features and below is one of the example
Is it possible to retrieve the category name of a feature configured in GSA using C#? I have tried IStorageImportCriteria and IClassImportCriteria but could not find the category information.
try it with the xft.
FeatureMgr mngr = new FeatureMgr();
var defee = mngr.GetFeatureDefs(true, true);
string category = defee.Current.CategoryName;
Thanks Martin. Worked like a charm.
I was able to get the information from class definition using below code but I think the solution provided by you is much cleaner and better.
IList<Bentley.ECObjects.Instance.IECInstance> currFeatureInstances = currentClassImp.ClassDefinition.GetCustomAttributeList(); foreach (Bentley.ECObjects.Instance.IECInstance iecInstance in currFeatureInstances)
if(iecInstance.ClassDefinition.Name == "ECXfm")
string featureCategory = iecInstance.GetPropertyValue("XfmCategory").NativeValue.ToString();