Step‐by‐step Guide - Nice3point/RevitTemplates GitHub Wiki
In this guide, we will walk you through each step of working with templates, from installation to deployment.
You will learn how to create a project, debug an application, and build an installer. All steps are demonstrated using JetBrains Rider IDE. If you’re using Visual Studio, don’t worry — the steps are nearly identical.
- Installation
- Create a New Project
- Creating Additional Modules
- Creating a Solution
- Publishing a Release
To install templates, simply run the following command in your terminal:
dotnet new install Nice3point.Revit.Templates
The templates will be installed, and you're ready to use.
To create a new project, click New Solution in Rider or Create a new Project if you are using Visual Studio:
- Select the desired template, such as Revit Addin for a single-project add-in.
- Name your project and choose the directory.
- Choose additional settings, such as whether to include WPF. If unsure, stick with the default settings.
Your project is now ready to launch.
- Choose the appropriate solution configuration to compile for a specific Revit version.
- Debug R25 compiles the solution for Revit 2025. The last two digits indicate the Revit version.
- Run configurations determine which application starts when debugging. Select your main application.
- Start debugging by clicking the appropriate button. Revit will launch automatically.
Debugging is pretty simple, without any additional setup. To debug:
- Set a breakpoint where you need to inspect the code.
- Click the add-in button in the Revit ribbon.
- The program will halt at the breakpoint, allowing you to inspect local variables.
For larger projects, a single-project solution may not be sufficient. Splitting your plugin into multiple modules is a best practice when managing unrelated processes.
To add another project to your solution, we will use the Revit AddIn Module and Revit AddIn Application templates.
- Select the template, in this case, Revit AddIn Application, which has fewer settings and files than
Revit AddIn
. - Name the project and choose its directory.
- Choose additional settings, such as adding DependencyInjection support. Use the defaults if you're unsure.
You will get a created application, however without modules, let's fix that. Right-click on your solution and select Add → New Project:
Configure the new module:
- Choose the Revit AddIn Module template.
- Name the module and select its directory.
- Configure additional settings, like whether to include WPF.
Add a reference to this module in your main project:
You can now add an ExternalCommand to execute code from this module, which you can trigger with a button click from the Revit ribbon:
For enterprise-level development, you might need a more structured solution, including a build system and an installer.
- Select the solution template, in this case Revit Addin Solution.
- Name the solution and choose the directory.
- Configure additional settings, such as whether to include an installer. Defaults are fine if you’re unsure.
Your solution will include a pre-built folder structure, the Nuke build system, and a Readme file with user instructions.
Follow the steps from previous sections to add projects to this solution:
Let's customize the build system:
- In Solution Items you will find frequently used solution files, you can add your own there, but right now we need Build.Configuration.cs.
- Update the InstallersMap property if your project name differs from the solution name. This will define a mapping between used installer project and the project containing the installation files.
- Update the Bundles property if your project name differs from the solution name. This will define projects packed in the Autodesk Bundle.
To create an installer on your local machine, first install the Nuke global tool:
dotnet tool install Nuke.GlobalTool --global
- Open the Readme.md file in your solution for instructions on building the installer, including publishing to GitHub.
- Open a terminal.
- Run the
nuke createinstaller
command. Alternatively, you can use the Run configurations in Rider to start the build process without using the terminal.
After a successful build, navigate to the solution folder:
You will find the installer in the output
directory:
There are several ways to create a Release, the easiest for beginner developers or project managers — GitHub:
-
Navigate to the Actions section on the repository page.
-
Select Publish Release workflow.
-
Click Run workflow button.
-
Specify the release version and click Run.
For the more advanced, or developers who want more control over releases, go to the publishing page.
Important
To create a release, changelog for the release version is required.
To update the changelog:
- Navigate to the solution root.
- Open the file Changelog.md.
- Add a section for your version. The version separator is the
#
symbol. - Specify the release number e.g.
# 1.0.0
or# Release v1.0.0
, the format does not matter, the main thing is that it contains the version. - In the lines below version, write a changes for this version. Style to your taste.
The build system is as flexible as possible, you can customize it to suit to your project usage.
Practice creating your plugins, and remember that templates are just a starting point. Your journey has just begun.