Frequent Revit 2024 Crashes with Python Tools

Hey everyone,

At our firm, we rely heavily on Python tools in Revit using PyRevit. Since I create and manage all of these tools, there are bound to be occasional bugs. However, with versions of Revit below 2024, this hasn’t been much of an issue. When a bug occurs, the user gets a PyRevit error message with the line number where the problem happened, and based on that info, I work on fixing it. Importantly, the user can usually continue working after the error message, and it’s quite rare for Revit to crash due to one of my tools.

However, starting with Revit 2024, even minor bugs seem to crash Revit entirely.

For my specific current example i get this Revit message:
image
With this PyRevit message:

line 1303, in FamilyInstance_Create
AttributeError: ‘NoneType’ object has no attribute ‘IsActive’

This is a small bug and easy to fix.
It is just very frustrating that this will crash Revit

Does anyone have an explanation for why this is happening in Revit 2024+?
Thanks in advance!

I work extensively with all versions of Revit on a daily basis.
2020 thru 2025.
No such issue. I work both with the release and the wip installers.

Better to open an issue on the repo and document the bug.

What does your Revit journal says?
Any chance you can share the code to reproduce?