Skip to content
d3 Wiki
04.03

C# style (Revit / Rhino plugins)

Plugins that survive Revit and Rhino version upgrades.

Updated
Oct 3, 2026
On this page

Purpose

Plugins that survive Revit and Rhino version upgrades.

The standard

  • .NET version per host: Rhino 8 → .NET 7 (net7.0-windows); Revit 2025+ → .NET 8; Revit ≤ 2024 → .NET Framework 4.8. Multi-target in one .csproj with Configurations per Revit year.

  • .editorconfig committed; dotnet format in CI; nullable enabled; warnings as errors.

  • One command per class; UI in WPF with MVVM; no logic in code-behind.

  • Revit: every model change inside a Transaction with a descriptive name; never hold Element references across transactions; use ElementId.

  • Rhino: subclass Command, use RhinoDoc.ActiveDoc only inside RunCommand, undo records for every doc change.

  • Third-party DLLs: prefer none; if needed, ILMerge/Costura to avoid conflicts with other add-ins.

Anti-patterns

Static caches of document objects; catching Exception silently; blocking the UI thread.

Owner: [TEAM] · Last reviewed: 2026-09