Shared Parameters Elements categories

Shared Parameters Elements categories

Anonymous
Not applicable
1,007 Views
3 Replies
Message 1 of 4

Shared Parameters Elements categories

Anonymous
Not applicable

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;
}

0 Likes
1,008 Views
3 Replies
Replies (3)
Message 2 of 4

dantartaglia8696
Advocate
Advocate

Hi,

 

Was there an answer for this?

 

Thanks,

Dan

Message 3 of 4

gu6ZQZF
Explorer
Explorer

I have exactly the same question today. 😂

0 Likes
Message 4 of 4

jeremy_tammik
Alumni
Alumni

You should be able to determine this from the BindingMap:

  

https://www.revitapidocs.com/2022/4ce777fb-ab30-6d15-d019-5b430223ac62.htm

 

> ... This map can be used to interrogate existing bindings...

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open