Multi category tags, Category by name error

Hello all, i have a weird problem…

I have found half of my solution allready which is in this post:

To be able to get the elements of multi category tags Category, i used the python script as instructed in that post.

However…

I dont want to use dropdown menu nodes for obvious reasons, so i am trying to use the Category by name node, which gives me the same problem.
I cant give the python script the category name as input because it gives an error message…

Can anyone tell me how to resolve this?

I want to enter the category by string into the python script, so the drop down menu doesnt shift when i open the script in another project…

Below the python script:

import clr

clr.AddReference(“RevitServices”)
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument

clr.AddReference(“RevitAPI”)
from Autodesk.Revit.DB import FilteredElementCollector

clr.AddReference(“RevitNodes”)
import Revit
clr.ImportExtensions(Revit.Elements)

def tolist(obj1):
if hasattr(obj1,“iter”): return obj1
else: return [obj1]

cat = UnwrapElement(IN[0])
OUT =

ueWrapper = None
wrappers = clr.GetClrType(Revit.Elements.ElementWrapper).GetMethods()
for w in wrappers:
if w.ToString().startswith(“Revit.Elements.UnknownElement”):
ueWrapper = w
break

if ueWrapper is not None:
fec = FilteredElementCollector(doc).WhereElementIsNotElementType()
if cat is not None:
fec = fec.OfCategoryId(cat.Id)
view_el =
for e in fec:
view_el.append(ueWrapper.Invoke(None, (e, True) ) )
OUT.append(view_el)


turn into checkboxes without a space for some reason…

image

1 Like

Thanks! That worked :slight_smile:
Could you explain why “Multi-Category Tags” doesnt work?
Even when i get the category name with the "Category name"node it gives me “Multi-Category Tags” as the proper name.

I’m not 100% sure about it.
But this has been discussed over the forum quite a few times in the past.
Search for it and you will find the answer!

You can start here:

And if you have trouble locating the OST name for a category (like you had with Multi-Category Tags), this script would be your go-to tool:

1 Like