Message 1 of 6
InternalException from FilteredElementCollector in Revit 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
But I'm dealing with a bug in Revit 2023 where an internal exception is thrown when attempting to iterate a FilteredElementCollector. The exception is only thrown under the following very specific conditions: ExternalApplication i.e. Revit 2023.
Please find the code snippet FilteredElementCollector -
// Set the category filter for the ebenelist
ElementMulticategoryFilter dbEbeneCategoryFilter = PosNumberEnter.GetCategoryFilter("EBENE");
List<string> ebeneList = GetEbeneList(doc, dbEbeneCategoryFilter);
if (ebeneList.Count > 0)
{
List<Color> ebeneGradient = CreateGradient(ebeneList.Count);
// Set the ebenefilterview
ViewFilters(doc, ebeneList, ebeneGradient, "Ebene");
}
catch (Exception ex)
{
// Trace
Trace.Indent();
Trace.WriteLine($"{MethodBase.GetCurrentMethod().DeclaringType.Name} {MethodBase.GetCurrentMethod().Name} Exception\n" +
$"trace: {ex.StackTrace}\n" +
$"message: {ex.Message}\n" +
$"data: {ex.Data.ToString()}\n" +
$"source:{ex.Source}\n" +
$"targetsite: {ex.TargetSite}\n" +
$"inner exception: {ex.InnerException}\n");
Trace.Unindent();
throw;
}
Please let me know if something is not clear. I look forward to hearing from you. Thank you!