How gcra101/revit-steel-reuse-tool works
Project Type and Purpose
• This is a desktop plugin suite for Autodesk Revit, implemented in C#/.NET (ReuseSchemeTool.sln).
• It consists of two complementary Revit add-ins (“Inspector Tool” and “Scheme Tool”) to assess existing steel frames for reuse and generate multi-format outputs (Revit sheets, Excel, PDF, JSON).
• The solution follows an MVC-style layering inside a host-plugin architecture and relies on the Revit API, Office Interop (Excel/PDF), and Newtonsoft.Json.
High-Level Architectural Components
a. Host Application
• Autodesk Revit (2020+)
• Loads .addin definition files and DLLs
b. Plugin Loader & Ribbon UI
• RevitRibbonTabsFactory (reads .addin XML, constructs “BH Plugins” tab)
• RibbonItemFactory / RibbonTabPanelFactory
c. Commands / Entry Points
• CommandInspectorTool.cs
• CommandSchemeTool.cs
• Implements IExternalCommand, invoked from Ribbon buttons
d. Controller Layer
• RST_Controller, EventsListener, AudioManagerInterface, ExceptionHandler, FilePathRetriever, MissingInputsHandler
• Manages workflow: splash screens, input collection, progress bar, error handling, sound cues
e. View Layer
• WinForms / WPF dialogs under view/ (InputsView, AboutBox, SplashScreen, ProgressBar)
• view/revit_plugin for Ribbon UI factories and command wiring
f. Model Layer
• Core domain: RST_Model, SteelFrame, FrameDecorator, Geometry, SurveyInfo, ReuseRatingCalculator, ReuseRatingStrategy, ProposedSteelFrame
• Data structures: RBTree, Observer pattern
• Converters & serializers: JSONSerializer, ExcelChartFactory, ExcelDataManager, RevitConverterInterface
• File managers: ControllerFileManager, RevitFileManager
• Configuration: AppConfig, InputSettings, EMRInputSettings
g. External Services & Outputs
• Revit API (collecting elements, creating sheets/views)
• Microsoft Office Interop (Excel, PDF)
• JSON (Newtonsoft.Json)
• Embedded resource files (images, sounds, text templates)
Relationships and Data Flows
• Revit UI ➔ Ribbon command activation ➔ CommandInspectorTool / CommandSchemeTool
• Command ➔ Controller orchestrates:
• View: show splash → about → inputs → folder picker → progress
• Model: collect Revit elements → calculate reuse ratings → decorate frames
• Output services: write Excel/PDF/JSON → push Revit ViewSheet
• Controller uses File Managers to read/write settings, Excel templates, text files.
• Model uses Observer pattern to notify views of progress.
Architectural Patterns and Principles
• Host-Plugin architecture (Revit as shell, add-ins as plugins)
• Model-View-Controller (separation of UI, orchestration, domain logic)
• Strategy pattern (ReuseRatingStrategy, RevitElemCollectorStrategy)
• Factory pattern (RibbonItemFactory, ExcelChartFactory, ColorsFactory)
• Observer pattern for progress updates
• Adapter pattern (ColorAdapter, RevitConverterInterface)
Technologies, Frameworks, Libraries
• .NET Framework (C#)
• Autodesk Revit API
• Windows Forms / WPF (dialog-based UI)
• Newtonsoft.Json
• Office Interop (Excel, PDF)
• Embedded resource management (sounds, images)
Essential Details
• Class groupings: controller/, model/, view/, view/revit_plugin/.
• Data managers (ExcelDataManager, JSONSerializer) as subcomponents of Output Services.
• Shared utilities (FileManager, Config).
• Don’t over-complicate—split into as many logical components as possible for clarity.