Код на шарпе , не тестил
private CategorySet GetCategories(SharedParameterElement sharedParameterElement)
{
var app = sharedParameterElement.Document.Application;
var doc = sharedParameterElement.Document;
DefinitionBindingMapIterator iterator = doc.ParameterBindings.ForwardIterator();
while (iterator.MoveNext())
{
Definition definition = iterator.Key;
if (definition is InternalDefinition)
{
var intDef = definition as InternalDefinition;
if (intDef.Id == sharedParameterElement.GetDefinition().Id)
{
ElementBinding elementBinding = (ElementBinding)iterator.Current;
CategorySet categorySet = elementBinding.Categories;
return categorySet;
}
}
}
return null;
}