BuiltInCategory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am constructing a treeview to match that within the Parameter Properties dialog that displays Categories for binding by Instance or Type. The only way I have found to achieve this is by creating two lists from the Built in Categories and iterating through them to retrieve their names.
This has worked fine with one exception.
Within the stairs category there are 3 sub categories (Landings, Runs and Supports) the respective BuiltInCategories I believe are:
BuiltInCategory.OST_StairsLandings,
BuiltInCategory.OST_StairsRuns,
BuiltInCategory.OST_StairsSupports,
When retrieving the name for BuiltInCategory.OST_StairsSupports the programme crashes.
The code for retrieving the name and adding to a list is:
foreach (BuiltInCategory builtInCategory in ParamGroups.parameterType()) { Category c = doc.Settings.Categories.get_Item(builtInCategory); if (c != null) { //make list of category names typeCategories.Add(c.Name); } }
The fact that the code works fine for all the categories but OST_StairsSupports suggests the code is OK?
Therefore is this the correct BuiltInCategory and is there a better way to create this treeview to match the Parameter Properties dialog?
Finally is there a way to filter the categories by discipline like the Parameter Properties dialog ?