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

dynamo

#1

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.


#2

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


#3

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


#4

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!


#5

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:


#6

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:


#7

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


#8

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


#9

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.


#10

you asked for suggestions,

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


#11

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


#12

yup


#13

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.