Skip to content

ScriptConsole cannot be re-created mid-session for persistent panels/modeless windows #3295

@Wurschdhaud

Description

@Wurschdhaud

For dockable panes and modeless windows (WPFMixin_ subclasses), the output window persists across command executions. When the user closes it, re-creating a functional ScriptConsole mid-session crashes Revit regardless of approach.

Attempted fixes (all crash):

  • new ScriptConsole() + swap into EXEC_PARAMS.window_handle + rewire ScriptIO/sys.stdout — mirrors sessionmgr._setup_output() but crashes mid-session
  • ScriptConsoleManager.CreateDetached() with explicit Show() on Dispatcher — crashes on show
  • Both with and without pre-registration in AppendToOutputWindowList

Suspected causes:

  • SetupDefaultPage() runs a DoEvents() busy-wait in the constructor, causing message loop re-entrancy when called outside the normal startup context
  • ScriptConsole may have implicit dependencies on the startup execution environment that aren't met when constructed on-demand

Expected behaviour: For persistent panels, closing the output window and re-running any panel method should produce a fresh, functional output window — the same behaviour regular commands get on each run.

Workaround: None currently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    New FeatureNew feature request [class->Implemented #{number}: {title}]

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions