The Revit Add-in
One obfuscated Pixy.dll that loads cleanly into Revit 2025, 2026 and 2027, hosting 20 tools across four ribbon panels — built around a Revit API that is single-threaded and hostile to every pattern a modern desktop app expects.
Architecture
One binary, three Revit versions
A single obfuscated Pixy.dll runs across every supported Revit version by multi-targeting net8.0-windows (Revit 2025/2026) and net10.0-windows (Revit 2027+), with compile-time API defines and a post-build step (PatchPixyRevitRefs) that rewrites the embedded Revit-API assembly-reference versions so one binary loads cleanly against any 25.x patch.
An AssemblyResolve shim installed in a static constructor redirects version-mismatched RevitAPI* loads to Revit’s already-resident assemblies. Without it, a customer on a patch release you never tested against gets a load failure instead of a plugin.
Why this matters commercially
Shipping a separate build per Revit version multiplies the release matrix, the QA surface and the support burden by three. Collapsing it to one artifact means one thing to sign, obfuscate, test and deploy — and a customer upgrading Revit does not need a new download.
Revit integration
Working within a hostile API
The Revit API is single-threaded and context-bound: it can only be touched from Revit’s own API thread, inside a transaction, during a command it initiated. Several core mechanisms exist purely to work within that constraint.
-
Modeless tool windows. WPF click handlers run with no Revit API context. A central ToolManagermarshals every geometry operation back onto Revit’s API thread through one sharedExternalEventfed by a concurrent action queue (RunInRevitContext). Tool windows are held instaticfields so they survive the command returning and can sit open indefinitely. -
Revit-2025 crash avoidance. ExternalEvent.Createis deferred to first use — calling it during startup crashes Revit 2025. UI-thread capture, deferred update checks and view-activation hooks are all deliberate workarounds;Idlingis never used, because it crashes off the UI thread. -
BCL version pinning. System.Text.Json,System.ManagementandSystem.Drawing.Commonare pinned to avoid fighting the copies Revit preloads. -
Namespace discipline. Revit, WPF, WinForms and System.Drawingcollide onGrid,Color,Point,Line,TransactionandView; pervasiveusing-aliases keep the code unambiguous.
The ribbon is one Pixy tab with four panels — Generate, Modify, AI Suite and Manage — built from PushButton/PulldownButton data, with icons rendered to 32×32 bitmaps and frame-animated “sparkle” buttons for the AI tools, because Revit cannot play GIFs on ribbon buttons.
Shared behaviour
How every tool behaves
-
Every tool runs modeless — Revit stays usable while a tool window is open. -
Most offer a live in-viewport preview with a debounce, and show a running count or result before you commit. -
Tool windows remember their on-screen position between sessions. -
Generate and Modify tools output editable DirectShape geometry; the AI Suite meters usage in pixels with the server as the single source of truth.
The tool suite · 7 tools
Generate panel
Parametric geometry driven by the faces and surfaces you pick, all emitting DirectShape solids.
| Tool | What it does | |
|---|---|---|
| Pattern Generator | Geometric void and solid patterns on straight, curved and freeform host faces. | Show details |
| Space Frame Generator | Structural shell grids and space-truss systems from any surface — mass, roof, floor or generic model. | Show details |
| Fin Generator | External profile fins laid along a face’s UV, with motion that varies across the surface. | Show details |
| Kinetic Generator | Kinetic-facade panels that respond to a driver such as sun angle. | Show details |
| Theme Generator | Apply coordinated colour schemes to views and view templates. | Show details |
| Image to Blocks | Turn an image into a mosaic of Revit elements. | Show details |
| Selection Filter | Find and bulk-select elements by their parameters. | Show details |
The tool suite · 6 tools
Modify panel
General-purpose editing, mostly on DirectShape geometry. Revit exposes no API to resize or rewrite host-element geometry in place — that constraint is the design rationale for these tools writing to DirectShapes, surfaced honestly as an explicit switch that keeps geometry, materials and category while dropping type parameters. Main tools take centimetre inputs; Floor Tools take metres.
| Tool | What it does | |
|---|---|---|
| Element Boolean | Combine, cut or split solids across any category into a new DirectShape. | Show details |
| Element Filler | Fill a picked boundary with copies of a picked element. | Show details |
| Face Editor | Subdivide a face into an N×M grid and work each segment like an editable poly. | Show details |
| Array | Duplicate a selection along a path or the X/Y/Z axes with graduated transforms. | Show details |
| Scale | Resize a selection uniformly or independently per axis. | Show details |
| Floor Tools | In-place floor edits that keep a floor a floor. | Show details |
The tool suite · 5 tools
AI Suite
Image-to-3D, rendering, export and AR publishing. Every tool signs in to PixyCloud first — silent on a licensed device. All third-party AI traffic is tunnelled through the Pixy server’s AI proxy, so provider API keys never touch the machine, and usage is metered in pixels shown before you commit. See Stage 4 for the proxy and metering behind these.
| Tool | What it does | |
|---|---|---|
| AI Modeler | Reference images to a generated 3D model, placed as a Revit DirectShape. | Show details |
| AI Library | Browse, place and publish your cached models, per Revit project. | Show details |
| GLB Exporter | Revit geometry to .glb or .gltf on disk. Runs entirely on your PC — free, 0 pixels. | Show details |
| AR Viewer | Publish a model and get a QR that opens it in AR on a phone. | Show details |
| Pixy Render / Pano | Capture the Revit scene as a 360° panorama or a still, then re-render it photorealistically. | Show details |
The tool suite · 2 tools
Manage panel
Account, entitlements and in-plugin support.
| Tool | What it does | |
|---|---|---|
| User Account | Sign-in, licences and entitlements — the PixyCloud account panel. | Show details |
| Support | In-plugin support desk, bridged to a Telegram admin console. | Show details |
Deep detail
Geometry engineering highlights
-
DirectShape-centric design. Because Revit cannot rescale or rewrite host elements, the generators produce DirectShapes and the Modify tools operate on them — a deliberate architectural throughline that is what makes Array, Scale and Boolean possible at all. -
Face-UV mapping. Fin, Kinetic and Face Editor pick faces, persist stable references and lay panels out in UV space; motion channels interpolate handle lists for gradient, wave and random fades. Live previews reuse the same engine outside a transaction, with triangle-count reporting so a truncated preview is not mistaken for a dropped result. -
AI-mesh → Revit. Generative GLBs are sliver-heavy and Revit rejects bad triangles one slow exception at a time, so the importer drops sub-1e-9 ft² slivers, groups by material, decimates, and submits to TessellatedShapeBuilderin 15,000-face batches — it degrades badly above that. -
Panorama pipeline. Only the cube-face capture touches Revit, because that is the single-threaded part; the equirectangular stitch is pure parallel pixel math with FOV calibration and an auto camera dolly.
Third-party building blocks: VoronoiLib (patterns), SharpVectors (SVG icons), SharpGLTF plus a custom GLTF reader (mesh I/O), QRCoder (AR QR codes), and Draco compression for uploads.