Skip to main content

Internal Exception Error

When I run an ElectroBIM command, it crashes with the following message:​

ElectroBIM

Exception Type: Autodesk.Revit.Exceptions.InternalException

A managed exception was thrown by Revit or by one of its external applications.

Cause​

The Autodesk.Revit.Exceptions.InternalException error occurs when the Revit API encounters an unexpected issue while processing a command or operation, typically one given to it by another application. In the context of ElectroBIM, the software is asking Revit to do something and Revit is failing in a way that neither ElectroBIM nor Revit can account for. For more information, visit the Revit API documentation and the Autodesk Revit API Developer's Guide.

While the error can occur due to bugs in the software making the API call, it is more often caused by issues within the Revit code or project.

Example​

When running the Circuit Edit command, ElectroBIM uses the GetAssignedElectricalSystems API call to get information from Revit about the circuits on the selected element. Normally, Revit will provide that information, or return an empty value if the selected element does not have any circuits. If the information on the element is corrupted or would otherwise cause the API call to return the wrong kind of result, it will instead result in an internal exception error.

Solution​

First, try restarting Revit, then running the command again. Restarting may resolve the issue that was causing the error.

If you continue getting the error using reproducible steps, contact us with information about the crash. It may be an issue we can raise with Autodesk, or a sign that your project is corrupted and needs to be restored from a backup.