Skip to content

Commit b78dd25

Browse files
committed
docs(overview): update architecture documentation with mermaid diagrams and debugging scripts
1 parent 2a0b51b commit b78dd25

File tree

2 files changed

+63
-39
lines changed

2 files changed

+63
-39
lines changed

docs/PythonDemo/architecture/00-overview.md

Lines changed: 60 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -49,42 +49,37 @@ RevitDevTool.PythonDemo/
4949

5050
### Dashboard Application Components
5151

52-
```
53-
┌─────────────────────────────────────────────────────────────┐
54-
│ Revit Host │
55-
│ │
56-
│ ┌──────────────────────────────────────────────────────┐ │
57-
│ │ Python Backend (revit_dashboard/) │ │
58-
│ │ │ │
59-
│ │ ┌──────────────┐ ┌─────────────────────────┐ │ │
60-
│ │ │ Collector │───▶│ Analytics Engine │ │ │
61-
│ │ │ (Revit API) │ │ (Polars) │ │ │
62-
│ │ └──────────────┘ └─────────────┬───────────┘ │ │
63-
│ │ │ │ │
64-
│ │ ▼ │ │
65-
│ │ ┌──────────────────────────────────────────────┐ │ │
66-
│ │ │ Presentation Layer │ │ │
67-
│ │ │ ┌────────────────────────────────────────┐ │ │
68-
│ │ │ │ WebView2 Host (C# + Python.NET) │ │ │
69-
│ │ │ │ ┌──────────────────────────────────┐ │ │ │
70-
│ │ │ │ │ React Frontend (dashboard-ui) │ │ │ │
71-
│ │ │ │ │ - Data visualization │ │ │ │
72-
│ │ │ │ │ - Dynamic filters │ │ │ │
73-
│ │ │ │ │ - Export triggers │ │ │ │
74-
│ │ │ │ └──────────────────────────────────┘ │ │ │
75-
│ │ │ └────────────────────────────────────────┘ │ │
76-
│ │ └──────────────────────────────────────────────┘ │ │
77-
│ │ ▲ │ │ │
78-
│ └───────────────────────┼────────────┼────────────────┘ │
79-
│ │ ▼ │
80-
│ Data Injection postMessage │
81-
│ │ │
82-
│ ┌──────────────────────────────────┼────────────────┐ │
83-
│ │ Excel Exporter │ │ │
84-
│ │ (openpyxl) └────────────────┼──▶│
85-
│ └────────────────────────────────────────────────────┘ │
86-
│ │
87-
└────────────────────────────────────────────────────────────┘
52+
```mermaid
53+
flowchart TB
54+
subgraph Revit["Revit Host"]
55+
subgraph Backend["Python Backend (revit_dashboard/)"]
56+
Collector["Collector<br/>(Revit API)"]
57+
Analytics["Analytics Engine<br/>(Polars)"]
58+
59+
Collector -->|Element data| Analytics
60+
61+
subgraph Presentation["Presentation Layer"]
62+
WebView["WebView2 Host<br/>(C# + Python.NET)"]
63+
64+
subgraph Frontend["React Frontend (dashboard-ui)"]
65+
Viz["Data visualization"]
66+
Filters["Dynamic filters"]
67+
Export["Export triggers"]
68+
end
69+
70+
WebView --> Frontend
71+
end
72+
73+
Analytics -->|Payload| Presentation
74+
end
75+
76+
Exporter["Excel Exporter<br/>(openpyxl)"]
77+
78+
Presentation -->|Data Injection| WebView
79+
Frontend -->|postMessage| Backend
80+
Frontend -->|Export request| Exporter
81+
Exporter -->|Excel file| Frontend
82+
end
8883
```
8984

9085
---
@@ -95,6 +90,34 @@ RevitDevTool.PythonDemo/
9590

9691
Each script demonstrates specific RevitDevTool features:
9792

93+
#### Debugging Scripts
94+
- **`debugpy_script.py`** - Demonstrates VSCode debugger integration with breakpoints
95+
96+
**Pattern:**
97+
```python
98+
# /// script
99+
# dependencies = ["numpy"]
100+
# ///
101+
102+
from Autodesk.Revit import UI
103+
104+
uidoc : UI.UIDocument = __revit__.ActiveUIDocument
105+
sel_ids = uidoc.Selection.GetElementIds()
106+
107+
# Set breakpoint here in VSCode
108+
for eid in sel_ids:
109+
el = uidoc.Document.GetElement(eid)
110+
print(el.Id, el.Name) # Inspect variables in debugger
111+
```
112+
113+
**Debugging workflow:**
114+
1. Set breakpoints in VSCode
115+
2. Press F5 → Attach to Revit Python (port 5678)
116+
3. Execute script in RevitDevTool
117+
4. Debugger pauses at breakpoints
118+
5. Inspect variables, step through code
119+
6. Shift + F5 -> Disconnect debugger
120+
98121
#### Visualization Scripts
99122
- **`visualization_xyz_script.py`** - Point picking and display
100123
- **`visualization_curve_script.py`** - Edge picking, curve generation and rendering
@@ -340,6 +363,7 @@ RevitDevTool.PythonDemo/
340363

341364
### Demo Scripts
342365
Each script declares dependencies via PEP 723:
366+
- **Debugging scripts:** `debugpy==1.8.20` (for VSCode debugger integration)
343367
- **Visualization scripts:** No dependencies (pure Revit API)
344368
- **Logging scripts:** No dependencies
345369
- **Data analysis:** `polars==1.38.1`

docs/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This folder contains **internal architecture documentation** for developers contributing to RevitDevTool.
44

5-
**For user guides and tutorials, see:** [RevitDevTool.Wiki](../../RevitDevTool.Wiki/)
5+
**For user guides and tutorials, see:** [RevitDevTool.Wiki](https://github.com/trgiangv/RevitDevTool/wiki)
66

77
---
88

@@ -82,7 +82,7 @@ Internal design documentation:
8282
## 🎯 For Different Audiences
8383

8484
### I want to **use** RevitDevTool
85-
👉 See: [RevitDevTool.Wiki](../../RevitDevTool.Wiki/)
85+
👉 See: [RevitDevTool.Wiki](https://github.com/trgiangv/RevitDevTool/wiki)
8686
- User guides and tutorials
8787
- API usage examples
8888
- Comparison with other tools
@@ -127,7 +127,7 @@ Internal design documentation:
127127

128128
## 🔗 Related Documentation
129129

130-
- **User Documentation:** [../RevitDevTool.Wiki/](../../RevitDevTool.Wiki/)
130+
- **User Documentation:** [RevitDevTool.Wiki](https://github.com/trgiangv/RevitDevTool/wiki)
131131
- **Source Code:** [../source/](../source/)
132132
- **Demo Commands (.NET):** [../source/RevitDevTool.DotnetDemo/](../source/RevitDevTool.DotnetDemo/)
133133
- **Demo Scripts (Python):** [../source/RevitDevTool.PythonDemo/commands/](../source/RevitDevTool.PythonDemo/commands/)

0 commit comments

Comments
 (0)