Skip to content

Templates

Roman edited this page Apr 11, 2024 · 22 revisions

All templates are fully supported by .Net, and you can use them in your favourite IDE, such as Visual Studio, JetBrains Rider or CLI.

These templates supports Revit 2020-2025 versions out of the box and can be extended without any limitations.

More information about dotnet templates: https://github.com/dotnet/templating/wiki

Templates:

If you are not sure what options to choose when creating a project, keep everything by default, templates uses optimal and frequently used settings. Or explore the samples before you start: https://github.com/Nice3point/RevitTemplates/tree/develop/samples

Revit AddIn

Suitable for single project add-ins. Perfect choice for small projects.

Just create a project, and it will already be ready to run in Revit.

  • The template already contains startup configurations, and you can run Debug for any Revit version without any setup.
  • Support for multiple Revit versions and different .Net versions is available by default.
  • The template provides the ability to create add-ins with or without a user interface, and more experienced developers can enable dependency injection and logging.
  • Choose whatever features you want, it's all optional.

изображение

Revit AddIn Application

Suitable for modular add-ins. Option for developers who want to create a distributed scalable application.

This template creates a main empty application containing only the entry point file and .addin manifest.

Optionally, you can enable Dependency injection support, where this application becomes a dependency provider for other modules.

Project based on this template should be used to combine all modules and connect them to the Revit ribbon, and it should not contain business logic if you plan to create a modular application.

изображение

Revit AddIn Module

Suitable for modular add-ins. Option for developers who want to create a distributed scalable application.

This template creates an empty module with or without user interface, containing files and dependencies necessary to implement the business logic.

The Inject dependecies option instead of creating an IExternalCommand will create a class that receives all dependencies from the Revit AddIn Application. Suitable for IoC use cases.

After creating a project based on this template, you have to add a reference to this project from Revit AddIn Application

Note: creating a project without UI based on this template will create a completely empty project, great for writing libraries for your add-in.

изображение

Revit AddIn Solution

Solution template. Suitable for enterprise development and developers who need a ready-made project structure with all core files, build system and installer.

This template contains:

  • Nuke build system
  • Installer project, that generates an .msi package
  • Auxiliary files such as .gitignore, Changelog.mb which are usually created in each solution. Readme.md contains documentation and instructions for building the project.
  • CI\CD setup
  • JetBrains Rider Run configurations

When creating a solution, be sure to check the box "Put solution and project in the same directory".

The solution template should be used before the project templates if you need it. And you have to create all plugins in produced solution, in the source folder

Nuke

Nuke is used to build a project for various configurations. In this case, for all specified Revit versions. It also allows you to automate other secondary processes, create an installer, post news on Twitter after build, order pizza, etc.

You do not need to use Nuke to debug the project, it is only needed for the release.

More details about Nuke here.

Installer

WixSharp was chosen as the installer, it is, like Nuke, based on a console application, this helps to make the creation of the installer automated and connect it to Nuke.

More details about WixSharp here.

изображение

Dependencies:

  • CommunityToolkit.Mvvm (optional) About
  • Nice3point.Revit.Api About
  • Nice3point.Revit.Toolkit About
  • Nice3point.Revit.Extensions About
  • Microsoft.Extensions.DependencyInjection (optional) About
  • Microsoft.Extensions.Hosting (optional) About
  • Serilog (optional) About
  • Autodesk.PackageBuilder (optional) About