Skip to content

Ap.DocManager().appContextOpenDocument() → dead process after closing the application #490

@CEXT-Dan

Description

@CEXT-Dan

Discussed in #489

Originally posted by gswifort March 13, 2026
I run the DOIT command and after opening the specified document, I close the application. This leaves a dead process.

from pyrx import command, Db, Ap  # noqa

DWG_PATH = ...  # !!!

@command
def doit():
    Ap.Application().registerOnIdleWinMsg(main)


def main():
    Ap.Application().removeOnIdleWinMsg(main)
    _open_doc_app_ctx(DWG_PATH)


def _open_doc_app_ctx(path) -> Ap.Document:
    doc_man = Ap.DocManager()
    doc_man.appContextOpenDocument(path)
    return doc_man.curDocument()
```</div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions