Message 1 of 4
Adding categories to existing parameter binding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I have this piece of code that (succesfully) adds a category to an existing parameter binding:
Categories.Add(BuiltInCategory.OST_Walls);
Categories.Add(BuiltInCategory.OST_Roofs);
Categories.Add(BuiltInCategory.OST_Floors);
Categories.Add(BuiltInCategory.OST_Assemblies);
foreach (BuiltInCategory BuiltInCategory in Categories)
{
Category Category = doc.Settings.Categories.get_Item(BuiltInCategory);
if (elemBind.Categories.Contains(Category) == false)
{ elemBind.Categories.Insert(Category); }
}
This code seems to work like a charm. In an example in which 3 of the 4 categories were already added, the fourt one is (in this case, Assemblies) added succesfully and when I lookup the actual variable values of the parameterbinding in Visual Studio, I see that all four categories are added:
However, back in the UI, the changes are neglected:
I also tried adding the following line, but unfortunetaly, to no avail.
doc.ParameterBindings.ReInsert(definition, rlemBind, Group);
I've seen multiple snippets from Jeremy that seem to work this way, like this simple one here:
The Building Coder: Adding a Category to a Parameter Binding (typepad.com)
Can anyone provide a clue?