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.

Table of content:

Installation

To install templates, simply run the following command in your terminal: dotnet new install Nice3point.Revit.Templates

image

The templates will be installed, and you're ready to use.

Create a New Project

To create a new project, click New Solution in Rider or Create a new Project if you are using Visual Studio:

image

Project Wizard Options:

  1. Select the desired template, such as Revit Addin for a single-project add-in.
  2. Name your project and choose the directory.
  3. Choose additional settings, such as whether to include WPF. If unsure, stick with the default settings.

image

Your project is now ready to launch.

Configuring the Solution:

  1. Choose the appropriate solution configuration to compile for a specific Revit version.
  2. Debug R25 compiles the solution for Revit 2025. The last two digits indicate the Revit version.
  3. Run configurations determine which application starts when debugging. Select your main application.
  4. Start debugging by clicking the appropriate button. Revit will launch automatically.

image

Debugging:

Debugging is pretty simple, without any additional setup. To debug:

  1. Set a breakpoint where you need to inspect the code.
  2. Click the add-in button in the Revit ribbon.
  3. The program will halt at the breakpoint, allowing you to inspect local variables.

image

Creating Additional Modules

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.

Create a New Project:

  1. Select the template, in this case, Revit AddIn Application, which has fewer settings and files than Revit AddIn.
  2. Name the project and choose its directory.
  3. Choose additional settings, such as adding DependencyInjection support. Use the defaults if you're unsure.

image

Adding a New Module:

You will get a created application, however without modules, let's fix that. Right-click on your solution and select Add → New Project:

image

Configure the new module:

  1. Choose the Revit AddIn Module template.
  2. Name the module and select its directory.
  3. Configure additional settings, like whether to include WPF.

image

Linking the Module:

Add a reference to this module in your main project:

image

You can now add an ExternalCommand to execute code from this module, which you can trigger with a button click from the Revit ribbon:

image

Creating a Solution

For enterprise-level development, you might need a more structured solution, including a build system and an installer.

Create a New Solution:

  1. Select the solution template, in this case Revit Addin Solution.
  2. Name the solution and choose the directory.
  3. Configure additional settings, such as whether to include an installer. Defaults are fine if you’re unsure.

image

Solution Setup:

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:

image

Customizing the Build System:

Let's customize the build system:

  1. In Solution Items you will find frequently used solution files, you can add your own there, but right now we need Build.Configuration.cs.
  2. 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.
  3. Update the Bundles property if your project name differs from the solution name. This will define projects packed in the Autodesk Bundle.

image

Building the Installer:

To create an installer on your local machine, first install the Nuke global tool:

dotnet tool install Nuke.GlobalTool --global

image

Running the Build:

  1. Open the Readme.md file in your solution for instructions on building the installer, including publishing to GitHub.
  2. Open a terminal.
  3. Run the nuke createinstaller command. Alternatively, you can use the Run configurations in Rider to start the build process without using the terminal.

image

After a successful build, navigate to the solution folder:

image

You will find the installer in the output directory:

image

Publishing a Release

There are several ways to create a Release, the easiest for beginner developers or project managers — GitHub:

  1. Navigate to the Actions section on the repository page.

  2. Select Publish Release workflow.

  3. Click Run workflow button.

  4. Specify the release version and click Run.

    image

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:

  1. Navigate to the solution root.
  2. Open the file Changelog.md.
  3. Add a section for your version. The version separator is the # symbol.
  4. 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.
  5. 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.

⚠️ **GitHub.com Fallback** ⚠️