Message 1 of 4
Shared Parameters Elements categories
Not applicable
02-13-2018
04:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
How to check if shared parameter is bound to a particular category, i hope can do this without family collector as is slower option.
//SHARED PARAMETER EXISTS - doesnt check if bound to a category todo
private static bool SPExistInProj(Document doc, string strShareParam)
{
bool existsSP = false;
FilteredElementCollector fec = new FilteredElementCollector(doc)
.OfClass(typeof(SharedParameterElement));
foreach (var r in fec)
{
SharedParameterElement shElem = r as SharedParameterElement;
InternalDefinition def = shElem.GetDefinition();
if (def.Name.Contains(strShareParam))
{
existsSP = true;
}
}
return existsSP;
}
Developer Advocacy and Support +