I get errors when importing from pyrevit
from pyrevit import EXEC_PARAMS
from pyrevit import revit
I checked the first import on 4.8.16.24121 and 5.0.0.25010.
The second one - only on 5.0.0.25010 (since I didn’t localize the problem right away).
Of course, instead of:
sender = EXEC_PARAMS.event_sender
args = EXEC_PARAMS.event_args
I use (although this method is not recommended in the documentation):
sender = __eventsender__
args = __eventargs__
And instead of:
doc = revit.doc
I use:
doc = args.GetDocument().
But both imports work fine in the command-before-exec[ID_FILE_IMPORT].py
hook. So I decided to point out the limitation.
If this is a known limitation, please let me know. And maybe this should be specified in the Note to “doc-updater.*
” in the documentation “Extension Hooks/”.