Question about the __revit__ variable in 2025

Hi All,

I was testing the WIP version on 2025 and was getting some errors in my startup & hooks scripts that revolved around the __revit__ variable. I was reading through the github issues about this HERE, which are all a bit over my head. It seems this issue is being worked on or possibly already fixed. My question is: Is there anything I would need to change in my own code where I use the __revit__ variable, or is it fixed in the background?

Thanks for all the hard work on the 2025 push!

This is an excellent question!

In my startup script I rather use:

doc = HOST_APP.doc
app = HOST_APP.app

in my hooks, I declare the document like so:

doc = __eventargs__.Document

and haven’t faced any issue so far with the very latest wip

As for the whole conversation around the variable itself, I never had the chance to look into it.
The question should be directed to @eirannejad who has the complete history, or to @sanzoghenzo who started digging into it.

2 Likes

Thanks for the explanation! I’ll try that out and see if it solves it.