"Generic Model Tags" category - "ElementQueries.OfCategory operation failed" internal error

Why does it give error when I try to get the instance of the “Generic Model Tags”?

I am trying to get the location of the tags already placed in the model and replace it with new one using this tool

grafik

Thanks in advance for your suggestions.

Coule anyone please explain the cause of it? Or is it something happening only for me ?

No errors here, have you tried on another model (test model) with only a single tag placed?

(I have no tags in my model)
image

1 Like

Thanks for your reply. Just tried it in a new test model, it works fine there. But not in the particular model I am working on!

My humble guess would then be that there are some irregularities in the tags and maybe some custom stuff going on in your original model. :slight_smile:

this is really bugging me and delaying the work to be finished. I will try to see if I could figure this irregular stuff in my model. Really appreciate your help. Thank you :slight_smile:

Alternatively if we’re to help we’d need you to upload the .rvt model (and many companies doesn’t allow this).

So helpful of you, but as you said the company rules doesn’t allow this and also its more than 300mb.

Took me sometime to get back to this problem. After quick search found out that this bug exists in the Dynamo itself, as per the post here, where it explained clearly:

So to solve my problem I quickly modified the code from @Dimitar_Venkov to collect all the elements of category and not from the specific view. Here the below the code which worked for me:

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)

I am using Revit 2018.3 and Dynamo 1.3.3.4111. Thank you.

2 Likes

you asked for suggestions,

i’d say overwrite the family with the new one, is that an option?

Pardon me! By Overwriting you mean making changes and reloading the family in Revit?

yup

Thats not the option in my case because already all the tags are placed and I need them only to access the properties. Also even when i reload the family, this problem occurs only for the Tags category.