Revit Visual Studio .NET Add-in Wizard の入手方法

※ この記事は、Revit 2026 までのバージョンに対応しています。

Revit アドイン開発者向けの Visual Studio のプロジェクトテンプレートが、弊社エンジニアによりリリースされております。今回は、Revit 対応の Visual Studio .NET Add-in Wizard の入手方法とインストール方法について解説いたします。

A computer screen displaying a project creation interface in a development environment, with options for Revit 2025 and 2026 add-ins, console applications, and ASP.NET Core web applications.

このプロジェクトテンプレートをインストールすることで、Visual Studio の新規プロジェクトの作成から、プロジェクトの初期設定やアドインマニフェストファイル、スケルトンコードを自動生成することができます。

プロジェクトの作成後、デバッグモードを実行すると、Revit が自動的に起動し、アドインがロードされ、外部コマンドまたは外部アプリケーションをデバッグすることができます。

そのため、検証用にサンプルコードを作成する際にも、とても便利です。 

  • スケルトンコードの自動生成
  • 外部コマンド: Command.cs
  • 外部アプリケーション: App.cs
  • アドインマニフェストファイルの自動生成
  • Revit SDK の参照設定
  • ビルド実行後の DLL ファイルおよびマニフェストファイルのデプロイ
  • デバッグ実行時の Revit.exe 起動設定
Screenshot of Visual Studio showing the 'New Project' window with options for creating a Revit 2020 Add-in in C# highlighted.
Code snippet demonstrating a C# class 'Command' implementing the 'IExternalCommand' interface in Microsoft Visual Studio, with elements related to execution and selection of Revit elements.



入手方法

以下の GitHub リポジトリから対象のバージョンのリリースをダウンロードすることができます。

Visual Studio Revit Add-in Templates

Revit バージョン毎に対応の最新リリースをダウンロードします。

Revit 各バージョンのビルド済みプロジェクトテンプレート(C#)


インストール方法(Revit 2023 まで)

インストールの大まかな流れは以下の通りです。

  1. ZIP ファイルを解凍します。
  2. それぞれの開発言語フォルダ内にある、アドインマニフェストファイル(RegisterAddin.addin)の VendorId タグの値を変更します。
  3. install.bat をテキストエディタで開き、下記内容を確認し適宜修正します。

    下記、14行目の[D=] 以下には、プロジェクトテンプレートを配置するフォルダのパスを指定します。ここで指定するパスは、Visual Studio のオプションダイアログ->[場所]で設定するパス(ユーザープロジェクトテンプレートの場所)と一致する必要があります。


    14行目 set “D=Y:\Documents\Visual Studio %1\Templates\ProjectTemplates”(修正前)

    Screenshot of Visual Studio 2019 options window showing project and item template locations.
  4. コマンドプロンプトを起動し、install.bat のあるディレクトリに移動して、install.bat の後に引数としてインストールする Visual Studio のバージョンを指定して実行します。※ Revit のバージョンではありません。

    A screenshot of the Windows Command Prompt displaying directory navigation and an installation command for a Visual Studio project.
  5. Visual Studio を起動し、[新しいプロジェクト]を開始すると、テンプレートの選択ダイアログに、Revit 20xx Addin が追加されていることを確認します。

インストール方法(Revit 2024, 2025, 2026)

  1. 上記、Revit 各バージョンのビルド済みプロジェクトテンプレート(ZIPファイル)をダウンロードします。
  2. Visual Studio を起動し、[ツール]->[オプション]からオプションダイアログを表示します。
  3. [場所]セクションの[ユーザー プロジェクト テンプレートの場所]で指定されているプロジェクトテンプレートの配置場所を確認します。
    A screenshot of a Visual Studio 2022 options window displaying project and item templates paths on a system.
  4. 上記、オプションで指定されている配置場所に、ダウンロードしたプロジェクトテンプレートの ZIP ファイルを配置します。Revit 2025 の場合は、現状、タグによる分類は未サポートとなっております。

 

ぜひ Revit アドイン開発にご活用ください。


By Ryuji Ogasawara

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading