@@ -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
9691Each 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
342365Each 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 `
0 commit comments