Why C#?
- Scalability
Start with:
Solution
- Start a solution / project
- Create a new project
- Choose the Revit Addin (Nic3Point) Template
- Configure your new project
- Name of the project
- Location
- Solution Name - same as project name (it’s a folder name that holds many projects)
- Additional Information
- Add-in type -> Application
- User Interface -> None
- IoC -> Disabled
- Serilog support -> unchecked
- Explore Visual Studio
- Properties & Solution Explorer (Project Browser in Revit)
- Error & Output
- CSProj -> Preconfigured up to Revit v.2025
- .addin -> Change GUID (The rest we will change later)
- Application Class:
- Tells your addin how to begin and how to finish when Revit opens and closes.
- Class: External Application
- Method: OnStartup()
- Will run “Create Ribbon()”
- Creates a Panel
- Adds a PushButton to that Panel
- With 2 Icons
- Our Application
- OnStartup
- When it begins, it calls a Function “CreateRibbon()”
- And CreateRibbon is a defined function below that:
- Creates a panel
- This is possible due to pre-configured Revit API that we are using
- CreatePanel - is a pre-defined method under Revit API that, you guessed it, Creates a Panel in Revit.
- Creates a button
- Same for the Button
- AddPushButton Method in Revit API - Creates a button
- Creates a panel
- Commands Folder
- Core Code
- Currently: Task Dialog - Shows the name of the addin
- ExternalCommand, but we should use IExternalCommand
- This is the part that writes the logic for your button
- Once you click the button, whatever is under Commands Folder connected to the button will be executed.
- If you change the TaskDialog.Show(Document.Title, “Hello World”);
- Once you press the button in Revit it would show “Hello World”
- Resources:
- Icons
- Everything is saved in windows explorer
- Configurations:
- Debug and Release
- Per Revit Version from R20 to R25
- References:
- Under: This PC > Windows (C:) > Program Files > Autodesk > Revit [2025].
- DLL Files that you can reference to your project to build something.
- You could even add an excel package to work with Excel, will do that later.
- Build and test the first plugin
- Build the solution by clicking on Run (Play Button) next to Any CPU.
- Lauches Revit (Version that you pre-configured)
- Always Load your Addin
- What happened behind the scenes:
- VS2022 Added the DLL file and the .addin file into the right folder and launched Revit version that you specified with the Plugin loaded into Revit.
- That became possible due to preconfigured Visual Studio Nic3Point Template that you ran earlier.
- Everything is already set and pathed for you for the ease of starting and launching plugins.
- Go to New Project
- Find your new panel in the panel tabs on the top of Revit User Interface.
- Find your Addin / Plugin
- Click on it
- And you will get a message with the name of your Tool.
- Stop Debug
- Closes Revit & Debug Mode
These tutorials were inspired by the work of Aussie BIM Guru. If you’re looking for a deeper dive into the topics, check out his channel for detailed explanations.