- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have been experiencing a very peculiar exception in one of my apps which throws the following exception:
An exception of type 'Autodesk.Revit.Exceptions.InternalException' occurred in RevitAPI.dll but was not handled in user code
Additional information: A managed exception was thrown by Revit or by one of its external applications
The reason why it is so peculiar is because it is inconsistent. For example, the same process will work, then if the inputs to the process are refreshed (i.e. the exact same test conditions), the exception is thrown.
I'll break the steps down to elaborate:
- I am creating a ElementIntersectsSolidFilter
- The input solid is derived from an element in a Revit link which itself is wrapped in my own class
- The filter is evaluated against elements in the active model
- The program executes within a Dynamo custom node
I've isolated the problem to the solid input to the filter. Since the problem was inconsistent - for example, if i input a list of elements from the linked model, extracted each elements solids and input them into the filter, the exception could occur with any of the elements at any time - I tried a simple test: use a try catch around the filter and if the exception is thrown, recreate the filter using the exact same inputs. With this simple workaround (and test), the few occasions where the exception is thrown is now caught, and so far everything is working as expected.
Has anyone experienced similar issues with the ElementIntersectsSolidFilter before and can anyone explain this odd behaviour. Why is it inconsistent? Why, when the exception does occur, does it only occur once per 'problem' solid?
Solved! Go to Solution.