# edwardhehe/batchprintzwcad architecture

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

- Interactive diagram: https://gitdiagram.com/edwardhehe/batchprintzwcad
- Repository: https://github.com/edwardhehe/batchprintzwcad

## Overview

LA批量打印 is a ZWCAD/AutoCAD .NET plugin for discovering drawing frames and producing batch or single-sheet outputs. Its main workflow begins with CAD commands, scans current or multiple drawings, lets users review and configure detected jobs, then plots or splits drawings. Separate capabilities include title-block libraries, settings and aliases, directory-table generation, PDF merging/stamping, and CAD-host integration. The README documents product flows; source excerpts confirm selected command, persistence, plotting, and split relationships. Unexcerpted scanning and UI internals are represented at their listed paths without asserting unverified calls.

Main entry points: [`src/Common/Commands/BatchPlotCommands.cs`](https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Commands/BatchPlotCommands.cs) (Plot commands), [`src/Common/Views/BatchPlotForm.xaml.cs`](https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Views/BatchPlotForm.xaml.cs) (Batch plot UI), [`src/AutoCAD/Plotter/PlotterService.Pipeline.cs`](https://github.com/edwardhehe/batchprintzwcad/blob/main/src/AutoCAD/Plotter/PlotterService.Pipeline.cs) (AutoCAD plotter), [`src/ZWCAD/Plotter/PlotterService.Pipeline.cs`](https://github.com/edwardhehe/batchprintzwcad/blob/main/src/ZWCAD/Plotter/PlotterService.Pipeline.cs) (ZWCAD plotter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Discovery and review"]
  node_commands["Plot commands"]
  node_scan["Frame scanning"]
  node_title_scan["Title-block scanning"]
  node_plot_ui["Batch plot UI"]
  node_single_ui["Single plot UI"]
end

subgraph group_output["Plotting and outputs"]
  node_paper["Paper selection"]
  node_acad_plot["AutoCAD plotter"]
  node_zw_plot["ZWCAD plotter"]
  node_pdf["PDF operations"]
  node_stamp["Signature stamping"]
  node_split["DWG splitting<br/>[DwgSplitService.cs]"]
  node_directory["Drawing directory"]
end

subgraph group_configuration["Libraries and settings"]
  node_settings[("App settings")]
  node_title_library[("Frame library")]
  node_signature_library[("Signature library")]
  node_library_ui["Frame library UI"]
end

subgraph group_host["CAD integration"]
  node_cad["CAD host"]
  node_menu["Menu integration"]
  node_autoload["Auto-load setup<br/>[AutoloadManager.cs]"]
  node_aliases["Command aliases"]
end

node_user(("CAD user"))

node_user -->|"invokes"| node_commands
node_commands -->|"starts scans"| node_scan
node_commands -->|"opens batch"| node_plot_ui
node_commands -->|"opens single"| node_single_ui
node_plot_ui -->|"requests scan"| node_scan
node_scan -.->|"uses frame rules"| node_title_scan
node_plot_ui -->|"selects paper"| node_paper
node_plot_ui -.->|"starts plotting"| node_acad_plot
node_plot_ui -.->|"starts plotting"| node_zw_plot
node_acad_plot -->|"loads settings"| node_settings
node_acad_plot -->|"applies stamps"| node_stamp
node_zw_plot -->|"loads settings"| node_settings
node_zw_plot -->|"applies stamps"| node_stamp
node_plot_ui -->|"requests DWG split"| node_split
node_plot_ui -->|"merges PDFs"| node_pdf
node_plot_ui -->|"generates table"| node_directory
node_library_ui -->|"loads and saves"| node_title_library
node_commands -->|"reads definitions"| node_title_library
node_stamp -->|"reads signature data"| node_signature_library
node_commands -->|"loads configuration"| node_settings
node_user -->|"uses menu"| node_menu
node_menu -->|"exposes commands"| node_commands
node_commands -->|"configures aliases"| node_aliases
node_user -->|"installs autoload"| node_autoload
node_autoload -->|"registers startup"| node_cad
node_commands -->|"runs in host"| node_cad

click node_commands "https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Commands/BatchPlotCommands.cs"
click node_scan "https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Services/Scanning/RectangleFrameScanner.cs"
click node_title_scan "https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Services/Scanning/TitleBlockScanner.cs"
click node_plot_ui "https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Views/BatchPlotForm.xaml.cs"
click node_single_ui "https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Views/SinglePlotForm.xaml.cs"
click node_settings "https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Models/AppSettingsStore.cs"
click node_title_library "https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Models/TitleBlockLibraryStore.cs"
click node_signature_library "https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Models/SignatureLibraryStore.cs"
click node_library_ui "https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Views/TitleBlockLibraryManagerForm.xaml.cs"
click node_paper "https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Services/Paper/PaperSizeDetector.cs"
click node_acad_plot "https://github.com/edwardhehe/batchprintzwcad/blob/main/src/AutoCAD/Plotter/PlotterService.Pipeline.cs"
click node_zw_plot "https://github.com/edwardhehe/batchprintzwcad/blob/main/src/ZWCAD/Plotter/PlotterService.Pipeline.cs"
click node_pdf "https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Services/Plotting/PdfDocumentService.cs"
click node_stamp "https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Services/Plotting/SignatureStampService.cs"
click node_split "https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Services/Plotting/DwgSplit/DwgSplitService.cs"
click node_directory "https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Infrastructure/DirectoryTableGenerator.cs"
click node_menu "https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Infrastructure/CadMenuInstaller.cs"
click node_autoload "https://github.com/edwardhehe/batchprintzwcad/blob/main/src/AutoCAD/AutoloadManager.cs"
click node_aliases "https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Infrastructure/CommandAliasManager.cs"

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_commands,node_scan,node_title_scan,node_plot_ui,node_single_ui,node_user toneBlue
class node_paper,node_acad_plot,node_zw_plot,node_pdf,node_stamp,node_split,node_directory toneAmber
class node_settings,node_title_library,node_signature_library,node_library_ui toneMint
class node_cad,node_menu,node_autoload,node_aliases toneRose
```

## Components

### Discovery and review

- [Plot commands](https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Commands/BatchPlotCommands.cs): `src/Common/Commands/BatchPlotCommands.cs`
- [Frame scanning](https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Services/Scanning/RectangleFrameScanner.cs): `src/Common/Services/Scanning/RectangleFrameScanner.cs`
- [Title-block scanning](https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Services/Scanning/TitleBlockScanner.cs): `src/Common/Services/Scanning/TitleBlockScanner.cs`
- [Batch plot UI](https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Views/BatchPlotForm.xaml.cs): `src/Common/Views/BatchPlotForm.xaml.cs`
- [Single plot UI](https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Views/SinglePlotForm.xaml.cs): `src/Common/Views/SinglePlotForm.xaml.cs`

### Plotting and outputs

- [Paper selection](https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Services/Paper/PaperSizeDetector.cs): `src/Common/Services/Paper/PaperSizeDetector.cs`
- [AutoCAD plotter](https://github.com/edwardhehe/batchprintzwcad/blob/main/src/AutoCAD/Plotter/PlotterService.Pipeline.cs): `src/AutoCAD/Plotter/PlotterService.Pipeline.cs`
- [ZWCAD plotter](https://github.com/edwardhehe/batchprintzwcad/blob/main/src/ZWCAD/Plotter/PlotterService.Pipeline.cs): `src/ZWCAD/Plotter/PlotterService.Pipeline.cs`
- [PDF operations](https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Services/Plotting/PdfDocumentService.cs): `src/Common/Services/Plotting/PdfDocumentService.cs`
- [Signature stamping](https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Services/Plotting/SignatureStampService.cs): `src/Common/Services/Plotting/SignatureStampService.cs`
- [DWG splitting](https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Services/Plotting/DwgSplit/DwgSplitService.cs): `src/Common/Services/Plotting/DwgSplit/DwgSplitService.cs`
- [Drawing directory](https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Infrastructure/DirectoryTableGenerator.cs): `src/Common/Infrastructure/DirectoryTableGenerator.cs`

### Libraries and settings

- [App settings](https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Models/AppSettingsStore.cs): `src/Common/Models/AppSettingsStore.cs`
- [Frame library](https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Models/TitleBlockLibraryStore.cs): `src/Common/Models/TitleBlockLibraryStore.cs`
- [Signature library](https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Models/SignatureLibraryStore.cs): `src/Common/Models/SignatureLibraryStore.cs`
- [Frame library UI](https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Views/TitleBlockLibraryManagerForm.xaml.cs): `src/Common/Views/TitleBlockLibraryManagerForm.xaml.cs`

### CAD integration

- **CAD host**
- [Menu integration](https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Infrastructure/CadMenuInstaller.cs): `src/Common/Infrastructure/CadMenuInstaller.cs`
- [Auto-load setup](https://github.com/edwardhehe/batchprintzwcad/blob/main/src/AutoCAD/AutoloadManager.cs): `src/AutoCAD/AutoloadManager.cs`
- [Command aliases](https://github.com/edwardhehe/batchprintzwcad/blob/main/src/Common/Infrastructure/CommandAliasManager.cs): `src/Common/Infrastructure/CommandAliasManager.cs`

### Other components

- **CAD user**

## Connections

- CAD user → Plot commands: invokes (evidence: `README.md`)
- Plot commands → Frame scanning: starts scans (evidence: `src/Common/Commands/BatchPlotCommands.cs`)
- Plot commands → Batch plot UI: opens batch (evidence: `README.md`)
- Plot commands → Single plot UI: opens single (evidence: `README.md`)
- Batch plot UI → Frame scanning: requests scan (evidence: `README.md`)
- Frame scanning → Title-block scanning: uses frame rules
- Batch plot UI → Paper selection: selects paper (evidence: `README.md`)
- Batch plot UI → AutoCAD plotter: starts plotting
- Batch plot UI → ZWCAD plotter: starts plotting
- AutoCAD plotter → App settings: loads settings (evidence: `src/AutoCAD/Plotter/PlotterService.Pipeline.cs`)
- AutoCAD plotter → Signature stamping: applies stamps (evidence: `src/AutoCAD/Plotter/PlotterService.Pipeline.cs`)
- ZWCAD plotter → App settings: loads settings (evidence: `src/ZWCAD/Plotter/PlotterService.Pipeline.cs`)
- ZWCAD plotter → Signature stamping: applies stamps (evidence: `src/ZWCAD/Plotter/PlotterService.Pipeline.cs`)
- Batch plot UI → DWG splitting: requests DWG split (evidence: `README.md`)
- Batch plot UI → PDF operations: merges PDFs (evidence: `README.md`)
- Batch plot UI → Drawing directory: generates table (evidence: `README.md`)
- Frame library UI → Frame library: loads and saves (evidence: `src/Common/Views/TitleBlockLibraryManagerForm.xaml.cs`)
- Plot commands → Frame library: reads definitions (evidence: `src/Common/Commands/BatchPlotCommands.cs`)
- Signature stamping → Signature library: reads signature data (evidence: `src/Common/Services/Plotting/SignatureStampService.cs`)
- Plot commands → App settings: loads configuration (evidence: `src/Common/Commands/BatchPlotCommands.cs`)
- CAD user → Menu integration: uses menu (evidence: `README.md`)
- Menu integration → Plot commands: exposes commands (evidence: `README.md`)
- Plot commands → Command aliases: configures aliases (evidence: `src/Common/Commands/BatchPlotCommands.cs`)
- CAD user → Auto-load setup: installs autoload (evidence: `README.md`)
- Auto-load setup → CAD host: registers startup (evidence: `README.md`)
- Plot commands → CAD host: runs in host (evidence: `README.md`)
