{"id":29406360,"url":"https://github.com/sey56/rscripting","last_synced_at":"2025-07-23T09:08:58.271Z","repository":{"id":303945876,"uuid":"1013101283","full_name":"Sey56/RScripting","owner":"Sey56","description":"Instant C# scripting in Revit via Roslyn and VS Code — built for speed and simplicity.","archived":false,"fork":false,"pushed_at":"2025-07-10T15:25:35.000Z","size":4945,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-10T17:06:30.149Z","etag":null,"topics":["automation","bim","csharp","revit","revit-addins","revit-api","roslyn","scripting"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sey56.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-03T11:06:40.000Z","updated_at":"2025-07-10T15:25:39.000Z","dependencies_parsed_at":"2025-07-10T17:06:49.820Z","dependency_job_id":"b6b33900-ddab-4aab-b919-7de7cc0db1b3","html_url":"https://github.com/Sey56/RScripting","commit_stats":null,"previous_names":["sey56/rscripting"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Sey56/RScripting","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sey56%2FRScripting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sey56%2FRScripting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sey56%2FRScripting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sey56%2FRScripting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sey56","download_url":"https://codeload.github.com/Sey56/RScripting/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sey56%2FRScripting/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266649220,"owners_count":23962191,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","bim","csharp","revit","revit-addins","revit-api","roslyn","scripting"],"created_at":"2025-07-10T23:20:04.932Z","updated_at":"2025-07-23T09:08:58.255Z","avatar_url":"https://github.com/Sey56.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\r\n  \u003cimg src=\"assets/rscript-logo.png\" alt=\"RScript Logo\" width=\"150\"/\u003e\r\n\u003c/p\u003e\r\n\r\n---\r\n\r\n# 🏗️ RScripting\r\n\r\n**Streamlined C# scripting for Revit — built on Roslyn, the Revit API, and VS Code**\r\n\r\nRScripting (short for Revit Scripting) is a minimal developer environment for writing and running Revit automation scripts — directly from **VS Code**.  \r\nIt executes top-level C# scripts instantly inside Revit using Roslyn — no builds, no packaging, no Visual Studio required.\r\n\r\nAt its core is `RScript`, the native Revit add-in that acts as the runtime engine. In Revit, it appears as a toggle button labeled **\"RScriptServer\"**, controlling the script execution server.  \r\nScripts are written in plain `.cs` files using standard C# syntax and powered by the Revit API. To simplify access, RScripting injects a few global variables such as `Doc`, `UIApp`, and `Transact`, making it fast to prototype without boilerplate.\r\n\r\nThe engine works with:\r\n\r\n- `rscript-bridge` — a lightweight .NET console tool that forwards scripts from VS Code to Revit  \r\n- `rscript-extension` — a VS Code extension that scaffolds a scripting workspace with IntelliSense, diagnostics, and command palette integration\r\n\r\nTogether, these form the RScripting stack — a fast, readable, and build-free automation pipeline for developers working with Revit.\r\n\r\n---\r\n\r\n## 🚀 Highlights\r\n\r\n- ⚡ **Instant execution** via Roslyn scripting  \r\n- 🧠 **Full IntelliSense** + Revit API access (through VS Code)  \r\n- 🔄 **Live feedback** in VS Code's output panel  \r\n- 🔧 **Minimal setup** — no DLL clutter or builds  \r\n- 📂 **Portable `.cs` workspace** — easy to version \u0026 share  \r\n- 🖥️ **Lightweight in-Revit toggle** — no embedded UI, just `RScriptServer` control\r\n\r\n---\r\n\r\n## ⚙️ Getting Started\r\n\r\n\u003e **Close both Revit and VS Code before installation**\r\n\r\n### 1️⃣ Clone \u0026 Build\r\n\r\nUse Git Bash (comes with [Git for Windows](https://git-scm.com)):\r\n\r\n```bash\r\ngit clone https://github.com/Sey56/RScripting.git\r\ncd RScripting\r\n./build.sh\r\n```\r\n\r\nSets up:\r\n- ✅ Revit Add-In\r\n- ✅ IPC Bridge\r\n- ✅ VS Code Extension\r\n\r\n---\r\n\r\n### 2️⃣ Create Your Scripting Workspace\r\n\r\nCreate a folder anywhere with any name:\r\n\r\n```bash\r\nmkdir TestWorkspace\r\ncd TestWorkspace\r\ncode .\r\n```\r\n\r\n---\r\n\r\n### 3️⃣ Initialize Workspace in VS Code\r\n\r\nRun:\r\n\r\n```\r\nCtrl + Shift + P → RScript: Initialize Workspace\r\n```\r\n\r\nClick **Restore** in the toaster notification.\r\n\r\nAdds:\r\n- `Scripts/` folder with starter scripts\r\n- IntelliSense stubs (`Doc`, `UIDoc`, `UIApp`, `Print`, `Transact`)\r\n- Preconfigured `.csproj`\r\n- `.vscode/tasks.json` for automation\r\n\r\n---\r\n\r\n### 4️⃣ Launch Revit \u0026 Start the Server\r\n\r\n- Open your Revit project  \r\n- Go to **Add-Ins → RScript Server**  \r\n- Toggle the server ON\r\n\r\n---\r\n\r\n### 5️⃣ Send Script to Revit\r\n\r\nBack in VS Code, run:\r\n\r\n```\r\nCtrl + Shift + P → RScript: Send To Revit\r\n```\r\n\r\nOr press:\r\n\r\n```\r\nCtrl + Alt + R\r\n```\r\n\r\n---\r\n\r\n### ✅ See Results\r\n\r\n- **VS Code Output Tab** → Channel: `RScript`  \r\n  ```\r\n  [PRINT 14:30:05] Creating wall centered at origin...\r\n  [PRINT 14:30:05] Wall created.\r\n  ```\r\n\r\n![Revit view with wall centered at origin](assets/wall-origin-grid.png)  \r\n**Figure**: Wall placed along the X-axis at the origin, with crossing grids for spatial reference.\r\n\r\n- **Local Logs** for diagnostics in local user's home directory:\r\n  - `CodeEditorError.txt`\r\n  - `RScriptBridgeLog.txt`\r\n  - `CodeRunnerDebug.txt`\r\n\r\n---\r\n\r\n## 🛠️ Build Options\r\n\r\nRScripting uses a single, streamlined build method:\r\n\r\n### 🐧 Build with Git Bash (Required)\r\n\r\n```bash\r\n./build.sh\r\n```\r\n\r\n- Runs in **Git Bash** (comes with [Git for Windows](https://git-scm.com))  \r\n- Installs:\r\n  - ✅ Revit Add-In  \r\n  - ✅ IPC Bridge  \r\n  - ✅ VS Code Extension  \r\n- Fast and reliable — no need for Visual Studio or manual copying\r\n\r\n---\r\n\r\n### 👨‍💻 Development Mode (Preserve bin \u0026 obj)\r\n\r\n```bash\r\n./build.sh --dev\r\n```\r\n\r\n- Keeps `bin` and `obj` folders after build (useful for debugging in Visual Studio)  \r\n- Skips cleanup step to support incremental development  \r\n- Ideal for contributors maintaining RScripting locally\r\n\r\n\u003e 💡 `build.sh` must be run in Git Bash. Other terminals like Command Prompt or PowerShell are not supported.\r\n\r\n---\r\n\r\n## 💻 Requirements\r\n\r\n| Component             | Version      |\r\n|----------------------|--------------|\r\n| Windows              | 10 or 11     |\r\n| Revit                | 2025         |\r\n| .NET SDK             | 8.0+         |\r\n| Node.js + npm        | Latest LTS   |\r\n| Visual Studio Code   | Latest       |\r\n| Git + Git Bash       | Required     |\r\n\r\n---\r\n\r\n## 📘 Tutorials\r\n\r\n- [Getting Started →](docs/getting-started.md)  \r\n- [Hello Revit →](docs/hello-revit.md)\r\n\r\n---\r\n\r\n## 📄 License\r\n\r\nMIT — free for personal and commercial use\r\n\r\n---\r\n\r\n## 👤 Author\r\n\r\n**Seyoum Hagos** — Architect · Developer · Workflow Designer  \r\n_Built in collaboration with Copilot and DeepSeek_\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsey56%2Frscripting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsey56%2Frscripting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsey56%2Frscripting/lists"}