A Revit plugin that integrates the IfcTester web application, providing a complete solution for IDS (Information Delivery Specification) authoring and auditing within Autodesk Revit.
Revit_9Uevr00Q4e-ezgif.com-gif-to-mp4-converter.mp4
This repository combines the IfcTester Revit plugin (C#/.NET) with the IfcTester Next web application (Svelte/Vite), creating a seamless integration that allows users to author and validate exported IFC files against IDS specifications directly within Revit. The web application runs in a dockable pane using WebView2, while Python-based validation runs client-side via WebAssembly/Pyodide.
- Revit Integration: Dockable pane in Revit with WebView2 hosting the web application
- IDS Authoring: Create and edit IDS documents with a modern web interface
- IFC Validation: Validate IFC models against IDS specifications using WebAssembly/Pyodide
- Element Selection: Select elements in Revit by IfcGUID from validation results
- HTTP API Server: Local server (port 48881) for bidirectional communication between Revit and web app
- Offline Support: Python packages bundled locally for offline operation
- Production Ready: Embedded web app served via WebView2 virtual host mapping
- Windows with Revit 2021-2026 installed (depending on configuration)
- .NET SDK - Download here
- .NET SDK 8.0+ for Revit 2025
- .NET Framework 4.8 for older Revit versions
- Node.js 18+ and npm - Download here
- WebView2 Runtime (usually installed with Windows)
- Visual Studio Code or your preferred IDE for C# and web development
- C# Dev Kit extension (required, for C# development)
- TailwindCSS extension (optional, but helpful for styling)
- Prettier extension (optional, for code formatting)
- Basic knowledge of JavaScript/TypeScript and web development (HTML, CSS)
- Familiarity with C# and .NET development
ifctester-revit/
├── revit/ # Revit plugin (C#/.NET)
│ ├── Application.cs # Entry point, creates ribbon and dockable pane
│ ├── IfcTesterRevitView.cs # WPF UserControl hosting WebView2
│ ├── RevitApiServer.cs # HTTP server for web app communication
│ ├── WebAppConfig.cs # Configuration for web app URL
│ ├── StartupCommand.cs # Ribbon button command
│ └── IfcTesterRevit.csproj # Project file
├── web/ # IfcTester Next web application (Svelte/Vite)
│ ├── src/
│ │ ├── modules/
│ │ │ ├── api/revit.svelte.js # Revit integration module
│ │ │ └── wasm/worker/ # WebAssembly worker for Pyodide
│ │ └── pages/Home/IdsViewer.svelte # Main IDS viewer/editor
│ ├── public/
│ │ ├── worker/bin/ # Python wheel files (ifctester, etc.)
│ │ └── pyodide/ # Pyodide runtime
│ ├── scripts/
│ │ └── download-packages.ps1 # Downloads Python packages for Pyodide
│ └── package.json
├── scripts/
│ └── deploy.ps1 # Unified build and deployment script
└── README.md # This file
git clone <repository-url>
cd ifctester-revitThe easiest way to get started is using the deployment script:
.\scripts\deploy.ps1 -Configuration "Debug R25"This script will:
- Download required Python packages (ifctester wheel) for Pyodide
- Build the web application
- Build the Revit plugin
- Copy the web app to the plugin directory
- Deploy everything to
%APPDATA%\Autodesk\Revit\Addins\2025\IfcTesterRevit\
Note: Make sure Revit is closed before running the deployment script.
cd revit
dotnet build IfcTesterRevit.csproj -c "Debug R25"The plugin will be automatically deployed to:
%APPDATA%\Autodesk\Revit\Addins\2025\IfcTesterRevit\
cd web
npm install
npm run devThe web app will start on http://localhost:5173/
The plugin automatically detects the web app URL. By default, it uses:
- Development:
http://localhost:5173/(when runningnpm run dev) - Production: Embedded web app served locally via WebView2 virtual host mapping
To set a custom URL, create a config file:
$configPath = "$env:LOCALAPPDATA\IfcTesterRevit\webapp.config"
New-Item -ItemType Directory -Force -Path (Split-Path $configPath)
Set-Content -Path $configPath -Value "http://your-server:5173/"- Open Revit 2025
- Navigate to the Add-ins tab in the ribbon
- Click the IfcTester button in the Audit panel
- The dockable pane will open showing the web application
The Revit plugin consists of several key components:
- Application.cs: Entry point that creates the ribbon panel and dockable pane on startup
- IfcTesterRevitView.cs: WPF UserControl that hosts the WebView2 control and handles navigation
- RevitApiServer.cs: HTTP server (port 48881) that exposes Revit API endpoints for the web app
- WebAppConfig.cs: Configuration system that determines the web app URL from environment variables, config files, or build settings
- StartupCommand.cs: External command that toggles the dockable pane visibility
The web application (web/) is a Svelte-based IDS authoring tool:
- src/modules/api/revit.svelte.js: Revit integration module that communicates with the Revit API server
- src/pages/Home/IdsViewer.svelte: Main IDS viewer/editor component
- src/modules/wasm/worker/: WebAssembly worker that runs Pyodide for Python-based validation
- Uses Vite for development and building
The Revit plugin exposes a local HTTP API on port 48881:
GET /status- Check server statusGET /select-by-guid/<guid>- Select element in Revit by IfcGUID
The web app automatically receives the API URL via JavaScript injection when the WebView2 loads.
Python packages (like ifctester) are downloaded during the build process and served locally:
- Download Script:
web/scripts/download-packages.ps1automatically fetches the latest ifctester version from PyPI - Storage: Wheel files are stored in
web/public/worker/bin/ - Runtime: The worker tries to install from local files first, falling back to PyPI if needed
- Benefits: Works offline, faster initialization, more reliable
The deployment script automatically downloads packages before building, ensuring all required wheels are available locally.
The easiest way to build for production:
.\scripts\deploy.ps1 -Configuration "Release R25"Or skip the web build if it's already built:
.\scripts\deploy.ps1 -Configuration "Release R25" -SkipWebBuildThis script:
- Downloads required Python packages (ifctester wheel) for Pyodide
- Builds the web application (unless
-SkipWebBuildis specified) - Builds the Revit plugin
- Copies the web app to the plugin directory
- Deploys everything to Revit's Addins folder
- Creates a
builtfolder in the revit directory with all files for easy distribution
The web app is embedded in the plugin and served locally via WebView2's virtual host mapping (app.localhost), so no external server is needed in production.
cd web
npm run buildThis creates a dist/ folder with static assets, including the Python wheel files from public/.
cd revit
dotnet build IfcTesterRevit.csproj -c "Release R25"The deployment script automatically copies the dist/ folder to the plugin directory, so the plugin can serve the web app locally using WebView2's virtual host mapping.
The plugin determines the web app URL in this order:
- Environment variable
WEB_APP_URL - Config file at
%LOCALAPPDATA%\IfcTesterRevit\webapp.config - Build configuration (Debug = localhost:5173, Release = embedded via virtual host)
The Revit API server port can be changed via:
- Environment variable
REVIT_API_URL(full URL including port) - Default:
http://localhost:48881
- Development mode: Ensure the dev server is running (
npm run devinweb/directory) - Check that port 5173 is accessible
- Verify the URL in
WebAppConfig.csmatches your dev server - Production mode: Check that the
webfolder exists in the plugin directory with all files
- Ensure the Revit API server is running (starts automatically with plugin)
- Check that elements have IfcGUID parameters set
- Verify the web app is connected (check connection status in UI)
- Check browser console for errors
If port 48881 is already in use:
- Stop the conflicting process
- Or change the port in
RevitApiServer.csand updateWebAppConfig.GetApiUrl()
- Ensure
download-packages.ps1was run during build - Check that wheel files exist in
web/public/worker/bin/ - Verify the config.json has the correct
ifctester_urlpath - Check browser console for Pyodide errors
This project was created by merging two existing projects:
-
IfcTester Next Web Application: The web application (
web/) is based on ifctester-next by theseyan, which provides IDS authoring and auditing capabilities in a modern web interface. -
Revit Plugin Base: The Revit plugin architecture is based on the aectech-2025-nyc-web-aec repository by vwnd, which demonstrates WebView2 integration patterns for Revit and Rhino plugins.
The merge included:
- ✅ Moving ifctester-next into ifctester-revit/web/
- ✅ Adapting the Revit plugin architecture from the aectech-2025-nyc-web-aec base
- ✅ Creating unified configuration system (
WebAppConfig.cs) - ✅ Setting up Pyodide package download system for offline Python package support
- ✅ Creating unified build and deployment script
- ✅ Comprehensive documentation
MIT License
Copyright (c) 2025 Byggstyrning
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.