Message 1 of 9
Parameter Bindings
Not applicable
01-07-2020
08:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello all,
I am using this code to add categories to existing parameters. Aim is to attach parameters defined in rooms automaticly to the generating walls of the room. I can do this manually via the userinterface, but ReInsert allways fails via API, any Idea?
Document doc = target.Document;
// Get the BingdingMap of current document.
BindingMap bindingMap = doc.ParameterBindings;
DefinitionBindingMapIterator it = bindingMap.ForwardIterator();
it.Reset();
while (it.MoveNext())
{
if (it.Key.Name.Contains(param))
{
if (it.Current is InstanceBinding EB)
{
EB.Categories.Insert(target.Category);
bool success = bindingMap.ReInsert(it.Key, EB);
return success; // success;
}
else
return false;
}
}