Skip to content

Commit f1b2d58

Browse files
authored
Merge pull request #3090 from dnenov/bugfix/app-hooks
Register extension hooks in C# session manager path
2 parents 93e8fa1 + c9ed04c commit f1b2d58

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pyrevitlib/pyrevit/loader/sessionmgr.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,14 @@ def _new_session_csharp():
304304
# Register loaded pyRevit assemblies with sessioninfo
305305
# so find_pyrevitcmd can locate commands
306306
_register_loaded_pyrevit_assemblies()
307+
# Register extension hooks
308+
# The Python session path (_new_session) registers hooks
309+
# after assembly creation, but the C# path was missing this
310+
try:
311+
for ui_ext in extensionmgr.get_installed_ui_extensions():
312+
hooks.register_hooks(ui_ext)
313+
except Exception as hook_ex:
314+
mlogger.error('Error registering hooks: %s', hook_ex)
307315
else:
308316
mlogger.error('C# session loading returned failure result')
309317
mlogger.info('Falling back to Python session creation...')

0 commit comments

Comments
 (0)