# CodeGuardian for Revit

CodeGuardian is a Revit add-in prototype for real-time, Grammarly-style advisory code compliance feedback.

## What It Does

- Adds a `CodeGuardian` ribbon tab to Revit and a `CodeGuardian` panel under Revit's `Add-Ins` tab.
- Scans design elements for advisory compliance warnings.
- Groups warnings by low, medium, and high priority.
- Uses yellow, orange, and red severity colors.
- Lets users choose building typology and thresholds in Options.
- Lets users set project state, local AHJ, adopted code edition, amendments, occupancy, construction type, fire protection, occupant-load basis, accessibility scope, professional review status, and selected permit/code requirements.
- Can import missing permit/code settings from Revit Project Information, title block parameters, and likely cover/code sheets.
- Lets users click a warning to select and zoom to the Revit element.
- Includes a starter download website and user-level installer script.

## Build

Revit 2025 or newer must be installed under `C:\Program Files\Autodesk\`.

```powershell
dotnet build .\CodeComplianceGuard.slnx
```

## Install For Local Revit 2025+

Install into every Revit version 2025 or newer found on this machine:

```powershell
.\installer\install.ps1
```

Install into specific versions:

```powershell
.\installer\install.ps1 -RevitVersion 2025,2026,2027
```

Restart Revit after installing. The add-in loads from:

`%APPDATA%\Autodesk\Revit\Addins\<version>\CodeGuard.Revit.addin`

Compatibility note: Revit 2025 and 2026 use `.NET 8`; Revit 2027 and newer use `.NET 10`. The installer chooses the target framework automatically for each Revit version it installs.

## Important Limitation

This prototype performs advisory checks only. Real US building code compliance depends on the adopted code edition, jurisdiction amendments, occupancy, construction type, fire protection, occupant load, accessibility scope, and professional judgment.
