# asdubewar/pynavis architecture

> Architecture diagram of the GitHub repository asdubewar/pynavis, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/asdubewar/pynavis
- Repository: https://github.com/asdubewar/pynavis

## Overview

pyNavis is a Navisworks add-in for running Python tools exposed through a reloadable, folder-defined ribbon. Users invoke a bundle by button, shortcut, hook, or startup action; the runtime selects a Python engine and executes its script against Navisworks, with the pynavis library providing domain helpers and UI. Bundled tools cover selection, clashes, viewpoints, data export, and AI-assisted authoring. The README documents the main capabilities; source excerpts are selective, so links for unsampled feature internals are limited to documented relationships.

Main entry points: [`src/PyNavis.Runtime/Execution/ScriptExecutor.cs`](https://github.com/asdubewar/pynavis/blob/main/src/PyNavis.Runtime/Execution/ScriptExecutor.cs) (Script execution), [`pynavislib/pynavis`](https://github.com/asdubewar/pynavis/tree/main/pynavislib/pynavis) (pynavis API), [`src/PyNavis.Runtime/Ai/AiSession.cs`](https://github.com/asdubewar/pynavis/blob/main/src/PyNavis.Runtime/Ai/AiSession.cs) (AI authoring session), [`src/PyNavis.Runtime/Ribbon`](https://github.com/asdubewar/pynavis/tree/main/src/PyNavis.Runtime/Ribbon) (Ribbon and shortcuts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_bundle_runtime["Bundles and runtime"]
  node_extension_bundles["Extension bundles<br/>[pyNavis.extension]"]
  node_ribbon["Ribbon and shortcuts<br/>[Ribbon]"]
  node_script_execution["Script execution<br/>[ScriptExecutor.cs]"]
  node_python_engines["Python engines<br/>[EngineManager.cs]"]
  node_event_hooks["Hooks and startup<br/>[Events]"]
  node_dock_panels["Dock panels<br/>[Panes]"]
end

subgraph group_python_api["Python library"]
  node_pynavis_library["pynavis API"]
end

subgraph group_navis_tools["Navisworks tools"]
  node_selection_sets["Selection and sets<br/>[sets.py]"]
  node_clash_tools["Clash tools<br/>[Clash.panel]"]
  node_viewpoint_tools["Viewpoint tools<br/>[Viewpoints.panel]"]
  node_data_tools["Data and exports<br/>[Data.panel]"]
  node_playground["Python playground<br/>[playground.py]"]
end

subgraph group_ai_authoring["AI authoring"]
  node_ai_chat["AI chat panel<br/>[AiChatPane.cs]"]
  node_ai_session["AI authoring session<br/>[AiSession.cs]"]
  node_generated_tools["Generated extensions"]
end

subgraph group_platform["Host services"]
  node_configuration[("Configuration<br/>[PyNavisConfig.cs]")]
  node_output_ui["Output and forms<br/>[Output]"]
end

node_user(("Navisworks user"))
node_navisworks["Navisworks host"]
node_ai_service["AI provider"]

node_user -->|"invokes tools"| node_ribbon
node_extension_bundles -->|"defines controls"| node_ribbon
node_ribbon -.->|"runs scripts"| node_script_execution
node_event_hooks -->|"runs scripts"| node_script_execution
node_script_execution -.->|"selects engine"| node_python_engines
node_script_execution -->|"executes in host"| node_navisworks
node_script_execution -->|"imports helpers"| node_pynavis_library
node_pynavis_library -->|"provides set helpers"| node_selection_sets
node_user -->|"manages selections"| node_selection_sets
node_user -->|"reviews clashes"| node_clash_tools
node_user -->|"manages viewpoints"| node_viewpoint_tools
node_user -->|"exports model data"| node_data_tools
node_user -.->|"runs experiments"| node_playground
node_dock_panels -.->|"hosts panel"| node_ai_chat
node_user -->|"requests a tool"| node_ai_chat
node_ai_chat -.->|"submits prompts"| node_ai_session
node_ai_session -->|"sends chat requests"| node_ai_service
node_ai_session -->|"writes tools"| node_generated_tools
node_generated_tools -->|"adds generated tools"| node_extension_bundles
node_configuration -.->|"configures engine"| node_python_engines
node_pynavis_library -->|"offers output UI"| node_output_ui

click node_extension_bundles "https://github.com/asdubewar/pynavis/tree/main/extensions/pyNavis.extension"
click node_ribbon "https://github.com/asdubewar/pynavis/tree/main/src/PyNavis.Runtime/Ribbon"
click node_script_execution "https://github.com/asdubewar/pynavis/blob/main/src/PyNavis.Runtime/Execution/ScriptExecutor.cs"
click node_python_engines "https://github.com/asdubewar/pynavis/blob/main/src/PyNavis.Runtime/Engine/EngineManager.cs"
click node_event_hooks "https://github.com/asdubewar/pynavis/tree/main/src/PyNavis.Runtime/Events"
click node_dock_panels "https://github.com/asdubewar/pynavis/tree/main/src/PyNavis.Runtime/Panes"
click node_pynavis_library "https://github.com/asdubewar/pynavis/tree/main/pynavislib/pynavis"
click node_selection_sets "https://github.com/asdubewar/pynavis/blob/main/pynavislib/pynavis/sets.py"
click node_clash_tools "https://github.com/asdubewar/pynavis/tree/main/extensions/pyNavis.extension/pyNavis.tab/Clash.panel"
click node_viewpoint_tools "https://github.com/asdubewar/pynavis/tree/main/extensions/pyNavis.extension/pyNavis.tab/Viewpoints.panel"
click node_data_tools "https://github.com/asdubewar/pynavis/tree/main/extensions/pyNavis.extension/pyNavis.tab/Data.panel"
click node_playground "https://github.com/asdubewar/pynavis/blob/main/extensions/pyNavis.extension/lib/playground.py"
click node_ai_chat "https://github.com/asdubewar/pynavis/blob/main/src/PyNavis.Runtime/Forms/AiChatPane.cs"
click node_ai_session "https://github.com/asdubewar/pynavis/blob/main/src/PyNavis.Runtime/Ai/AiSession.cs"
click node_generated_tools "https://github.com/asdubewar/pynavis/blob/main/src/PyNavis.Runtime/Ai/GeneratedExtensionWriter.cs"
click node_configuration "https://github.com/asdubewar/pynavis/blob/main/src/PyNavis.Runtime/Config/PyNavisConfig.cs"
click node_output_ui "https://github.com/asdubewar/pynavis/tree/main/src/PyNavis.Runtime/Output"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_extension_bundles,node_ribbon,node_script_execution,node_python_engines,node_event_hooks,node_dock_panels,node_user toneBlue
class node_pynavis_library toneAmber
class node_selection_sets,node_clash_tools,node_viewpoint_tools,node_data_tools,node_playground toneMint
class node_ai_chat,node_ai_session,node_generated_tools toneRose
class node_configuration,node_output_ui,node_navisworks,node_ai_service toneIndigo
```

## Components

### Bundles and runtime

- [Extension bundles](https://github.com/asdubewar/pynavis/tree/main/extensions/pyNavis.extension): `extensions/pyNavis.extension`
- [Ribbon and shortcuts](https://github.com/asdubewar/pynavis/tree/main/src/PyNavis.Runtime/Ribbon): `src/PyNavis.Runtime/Ribbon`
- [Script execution](https://github.com/asdubewar/pynavis/blob/main/src/PyNavis.Runtime/Execution/ScriptExecutor.cs): `src/PyNavis.Runtime/Execution/ScriptExecutor.cs`
- [Python engines](https://github.com/asdubewar/pynavis/blob/main/src/PyNavis.Runtime/Engine/EngineManager.cs): `src/PyNavis.Runtime/Engine/EngineManager.cs`
- [Hooks and startup](https://github.com/asdubewar/pynavis/tree/main/src/PyNavis.Runtime/Events): `src/PyNavis.Runtime/Events`
- [Dock panels](https://github.com/asdubewar/pynavis/tree/main/src/PyNavis.Runtime/Panes): `src/PyNavis.Runtime/Panes`

### Python library

- [pynavis API](https://github.com/asdubewar/pynavis/tree/main/pynavislib/pynavis): `pynavislib/pynavis`

### Navisworks tools

- [Selection and sets](https://github.com/asdubewar/pynavis/blob/main/pynavislib/pynavis/sets.py): `pynavislib/pynavis/sets.py`
- [Clash tools](https://github.com/asdubewar/pynavis/tree/main/extensions/pyNavis.extension/pyNavis.tab/Clash.panel): `extensions/pyNavis.extension/pyNavis.tab/Clash.panel`
- [Viewpoint tools](https://github.com/asdubewar/pynavis/tree/main/extensions/pyNavis.extension/pyNavis.tab/Viewpoints.panel): `extensions/pyNavis.extension/pyNavis.tab/Viewpoints.panel`
- [Data and exports](https://github.com/asdubewar/pynavis/tree/main/extensions/pyNavis.extension/pyNavis.tab/Data.panel): `extensions/pyNavis.extension/pyNavis.tab/Data.panel`
- [Python playground](https://github.com/asdubewar/pynavis/blob/main/extensions/pyNavis.extension/lib/playground.py): `extensions/pyNavis.extension/lib/playground.py`

### AI authoring

- [AI chat panel](https://github.com/asdubewar/pynavis/blob/main/src/PyNavis.Runtime/Forms/AiChatPane.cs): `src/PyNavis.Runtime/Forms/AiChatPane.cs`
- [AI authoring session](https://github.com/asdubewar/pynavis/blob/main/src/PyNavis.Runtime/Ai/AiSession.cs): `src/PyNavis.Runtime/Ai/AiSession.cs`
- [Generated extensions](https://github.com/asdubewar/pynavis/blob/main/src/PyNavis.Runtime/Ai/GeneratedExtensionWriter.cs): `src/PyNavis.Runtime/Ai/GeneratedExtensionWriter.cs`

### Host services

- [Configuration](https://github.com/asdubewar/pynavis/blob/main/src/PyNavis.Runtime/Config/PyNavisConfig.cs): `src/PyNavis.Runtime/Config/PyNavisConfig.cs`
- [Output and forms](https://github.com/asdubewar/pynavis/tree/main/src/PyNavis.Runtime/Output): `src/PyNavis.Runtime/Output`

### Other components

- **Navisworks user**
- **Navisworks host**
- **AI provider**

## Connections

- Navisworks user → Ribbon and shortcuts: invokes tools (evidence: `README.md`)
- Extension bundles → Ribbon and shortcuts: defines controls (evidence: `README.md`)
- Ribbon and shortcuts → Script execution: runs scripts
- Hooks and startup → Script execution: runs scripts (evidence: `README.md`)
- Script execution → Python engines: selects engine
- Script execution → Navisworks host: executes in host (evidence: `README.md`)
- Script execution → pynavis API: imports helpers (evidence: `README.md`)
- pynavis API → Selection and sets: provides set helpers (evidence: `README.md`)
- Navisworks user → Selection and sets: manages selections (evidence: `README.md`)
- Navisworks user → Clash tools: reviews clashes (evidence: `README.md`)
- Navisworks user → Viewpoint tools: manages viewpoints (evidence: `README.md`)
- Navisworks user → Data and exports: exports model data (evidence: `README.md`)
- Navisworks user → Python playground: runs experiments
- Dock panels → AI chat panel: hosts panel
- Navisworks user → AI chat panel: requests a tool (evidence: `README.md`)
- AI chat panel → AI authoring session: submits prompts
- AI authoring session → AI provider: sends chat requests (evidence: `README.md`)
- AI authoring session → Generated extensions: writes tools (evidence: `README.md`)
- Generated extensions → Extension bundles: adds generated tools (evidence: `README.md`)
- Configuration → Python engines: configures engine
- pynavis API → Output and forms: offers output UI (evidence: `README.md`)
