So I am finally understanding what goes ‘wrong’.
Let me explain it better (now I understand the cause).
I have a hook that checks a file name.
- I run a script
- script print ‘running script started’
- output window popup showing ‘running script started’.
- Script opens projectfile in the background
- script print ‘loaded from file …’
- NEW output window popup showing ‘loaded from file ….’
- Script opens another projectfile in the background
- script print ‘loaded from file …’
- ANOTHER output window popup showing ‘loaded from file ….’
What python does:
The popup has an OutputId which is set tot the pyRevit command it belongs to.
source: pyrevitlib/pyrevit/output__init__.py/def output_id(self)
So
-
popup = script id.
-
popup = hook check_file_name is probably seen as new pyrevit command thus new popup
-
popup = hook check_file_name is probably seen as new pyrevit command thus new popup
This is what I think is happening.
Unsure if it’s logical to have hooks labelled as pyrevit commands.
Your thoughts?