Internal Error: Keynote Tags - All Elements of Category

Yeah, I have already tried that and I keep getting the same message:
Warning:
IronPythonEvaluator.EvaluateIronPythonScript operation failed.
An internal error has occurred.

When I do it view by view, 80% of the time it works fine, but for 20% I get that message. I haven’t been able to figure out what is wrong with those views that could be triggering that error. So, when I do it for all the Tags on the project I get the same Warning. I am going to keep comparing those views and tags to see if there is something wrong with them. But I am pretty sure the script should be working.
This is my script to collect them all:
import clr
clr.AddReference(“RevitNodes”)
import Revit
clr.ImportExtensions(Revit.Elements)
clr.AddReference(“RevitAPI”)
import Autodesk
*from Autodesk.Revit.DB import **
clr.AddReference(“RevitServices”)
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
import clr
collector = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_KeynoteTags).WhereElementIsNotElementType().ToElements()
OUT = collector

Hi Guys,

Anyone has found a way around to get this issue resolved. I’ve used both the Dynamo node " All elements of Category" and the Revit API “FilteredElementCollector” and neither one of them worked for wall tags. It works fine though for columns.

I was looking for this solution also (R2020.2.6) and determined at least one root cause and a workaround.

This error is repeatable when you have a keynote without a keyvalue.

For example if you create a user keynote and fail to select a key value Revit will create the keynote instance without a value. If these are present anywhere in the project the element collectors will fail.

Simple workaround is to just create a keynote schedule to select the empty keynotes and delete them.

I tried your method suggested here – did find two key values that were totally blank, but it didn’t solve the problem. Has anyone had success with either Python or another version of Dynamo? Seems this is a lingering issue with Keynote Tags in particular.

Best to start a new thread, and provide a data set (.RVT) so that the help we give is relevant to your setup.

What works on project 1 will not necessarily work on project two and vice versa.

@jacob.small - looks like same issue in REvit 2022…
image

1 Like

Anyone start a new thread? (This is why we need the old IRC Threaded chat module- sub-chat of the original one-thread-down : )

I don’t see any.

When in doubt, give it a search, and if nothing turns up start a post. We admins can always link/remove/whatnot as needed. Be sure to include a data set to reproduce the issue.

1 Like

I am not sure, but I have seen the FEC fail when the Tag has been used in a Legend. I don’t recall why it didn’t work, but maybe check it in one view and see if it works?

Bumping this. Not sure it’s worth starting another thread as there seems to be a commonality with simply not being able to select Keynote tags in certain projects.

I’ve tried the solutions suggested above and no dice… ultimately I’m trying to find all user-defined keynotes in a project and change their type but I currently can only select ‘by view’ which simply isn’t practical…

Did anyone ever get a robust solution to this problem?

I had a similar problem a while back with electrical tags. The issue is, the wrapper for that element can’t be found for some reason.

I’ve found that spring nodes will wrap the elements for you fairly often,

2 Likes

Sadly, still a Null list here… but thanks for the suggestion.

Hmm. Able to share a small sample file? And which dynamo and revit version specifically?

1 Like

Not really - this is a rather large project, however, I’ve narrowed it down to 3 offending views just trying to figure out what it is about those views that are causing the problem… I thought it might have been the issue with a user tag without a corresponding value for the keynote but it seems not… I’ll keep digging away at it and see if I can find what the trigger is.

I can find no logic/reason for this issue. I can narrow it down to a single view in the model but even if I delete everything in this view but retain the actual view the issue persists. If I delete the view entirely the issue goes away… I can at least progress with what i need to achieve as the view(s) in question are not critical but I’m at a complete loss as to what is causing the problem…

Is it a 3d view or a 2d one? Are there dependents? Anything which makes this view unique among the rest?

Try disabling templates, crop boxes, and other stuff about the view to see if something with how the view is configured is the blocker. Adjust the range to be unlimited as well in case it’s that.

2D view, and no different to any of the others around it that aren’t causing any issues… I’ve turned everything off, removed any design options, all filters, linked files etc from that view and still no dice…

If you want to take a look I’ll happily set up a teams call… :slight_smile:

I’ve been quite booked up today and tomorrow, but have some time on Thursday and Friday morning. DM me and we can set up a time. :slight_smile:

I encountered this issue on an older large project in Revit 2019 when I was trying yesterday to work with Keynote Tags. This thread was very useful in stopping me banging my head against a wall. I tried a few things as mentioned above:

  • All Elements of Category resulted in the same An internal error has occured
  • A filtered element collector within a Python node FilteredElementCollector(doc, view.Id).OfCategory(bic) resulted in the same error when attempting to pass out the collected elements. The best I could manage was to get the Element Ids from the collector but then any further attempt to process this to get the tag itself failed, e.g. doc.GetElement(id)
  • I resorted to going outside of Dynamo by writing an add-in in C# with a filtered element collector
    FilteredElementCollector fec = new FilteredElementCollector(doc, view.Id).OfCategory(BuiltInCategory.OST_KeynoteTags).Cast<IndependentTag>();
    And that worked. I was able to iterate over the collector and act on the tags as desired.
4 Likes

Just encountered the same issue on a large scale model, regarding electrical tags and it seems like the issue is within the API:

Tried getting those elements through the API also like this and the end result was the same:

Finally, this is as far as I could get in finding a workaround:

I get all the tag Ids with FilteredElementCollector, then select the elements by Id. I then noticed it is actually 3 of the tags that return the same ‘internal error’. It’s quite weird, cause they can be selected by id in the document. It’s still hard to see what could be wrong with them, as it would take quite a lot of time finding those elements. However, in my case I need to work with those tags’ types and I see only 3 nulls, so the chance of having one of them being an element representing a single instance of that type is extremely low (considering they have 2 types in total). Alternatively, those problematic Ids can be submitted as a report, so that they can be checked manually