Inventor Apperentice Server 2026 利用時の注意点

Inventor Apprentice Server interface displayed in Visual Studio with code snippets and the Inventor logo.

ブログ記事:Inventor 2026 API関連情報にてご案内をしましたが、Inventor 2026よりInventor Apperentice Serverの配布方法に大きな変更が加えられておりますが、この変更がInventor Apperentice Serverを用いたカスタマイズを開発されている方にとって、どのような影響があるのかが判りにくいと思われます。

この記事では、Inventor 2026でのInventor Apperentice Serverの利用方法での留意点についてご案内をいたします。

 

Inventor 2026での変更点

では、Inventor 2026のInventor Apperentice Serverは何が変わったのでしょうか?以前の記事Inventor 2026 API関連情報でも記載しましたが、従来よりInventor Apprentice ServerはInventor Professionalと共にインストールがされておりましたが、Inventor 2026よりInventor Professionalと一緒にインストールされるInventor Apprentice Serverはレジストリフリー化が行われております。

このInventor 2026 Professionalと共にインストールされるInventor Apprentice Serverコンポーネントは、カスタムアプリケーションからは利用することが出来ません。このためInventor 2026のInventor Apperentice Serverを利用する場合は、ダウンロードサイトからインストーラを取得し、インストールをしたコンポーネントを利用する必要があります。

この個別のインストーラでインストールしたApperentice Serverは従来通りの、レジストリ登録を行うCOMコンポーネントのため、VBA等からもご利用が可能です。

またこの変更に伴い、Inventor Professional 2026ではInventorの起動時にInventor Apperentice Serverのレジストリ登録を行わないよう動作が変更がされております。これはInventor 2026 ProfessionalがインストールするInventor Apperentice ServerのCOMコンポーネントがレジストリフリー版(=レジストリ登録が不要であるCOMコンポーネント)であるためです。

 

注意が必要なポイント

ここまでを読まれて、「Inventor 2026からは、Apperentice Serverを別にインストールする必要があるんだ~」ぐらいの変更と思われた方もいらっしゃるかもしれませんが、実はインストール後のカスタマイズの開発、実行時にも注意が必要な点があります。

あまり意識をされていない方が多いかと思いますが、実はInventor 2025以前の場合、Inventorは起動時にInventor Apperentice Serverのレジストリ登録を更新しておりました。このため、複数のInventorのバージョンが混在している環境では、最後に起動したInventorバージョンのApperentice Serverが有効となっていました。

ところが、Inventor 2026からはInventorの起動時にApperentice Serverのレジストリ登録を更新しなくなったため、例えば以下の様な状況が発生することとなります。

・インストール環境

Inventor Pro 2025
Inventor Pro 2026
Standalone Apprentice Server 2026

・処理手順

1.Inventor 2025を起動する⇒この時点で、Apprentice Server 2025がアクティブとなる(=レジストリ登録される)

2.Invenotr 2026を起動する⇒Inventor Apprentice Server 2026のレジストリ登録はされないため、Apprentice Server 2025がアクティブな状態

この状態の場合、「Visual StudioでApprentice Server 2026のタイプライブラリを参照しても、Apprentice Server 2025のタイプライブラリを参照してしまう」「Apprentice Serverを利用するカスタムアプリケーションを実行すると、Apprentice Server 2026を使いたいのに2025が使われてしまう」といった現象が発生いたします。

この状況でInventor Apprentice Server 2026を利用したい場合にはInventor 2026の起動ではなく、以下のコマンドを実行してApprentice Server 2026のコンポーネントのレジストリ登録を行う必要があります(インストールパスが異なる場合はパスを変更してください)。

 

“C:\Program Files\Autodesk\Inventor Apprentice Server 2026\Bin\ApprenticeRegSvr.exe” /install

 

これまで、Inventor Apprentice Serverを用いたカスタマイズを開発・利用されていた方の中には、経験的に「利用したいバージョンのInventorを起動してからApprentice Server を利用するカスタマイズを実行する」といった事をされていた方がいらっしゃるかもしれませんが、Inventor 2026以降では明示的にInventor Apprentice Server 2026のレジストリ登録を行う必要があることになります。

 

複数バージョンのInventorが混在する環境で、Inventor Apprentice Serverを用いたカスタマイズを開発・利用される場合は、この点にご留意ください。

 

By Takehiro Kato


Comments

3 responses to “Inventor Apperentice Server 2026 利用時の注意点”

  1. こんにちわ。
    AppStoreにApprenticeServerを利用しているツールを公開しているのですが、ここ数週間でInventor2026ユーザーから使用できないとの問い合わせが届くようになりました。
    都度、「Inventor Apprentice Server 2026を別途installしてくれ」と返答しているものの、ユーザー体験としてあまり良くないと思っています。
    もう、
    “C:\Program Files\Autodesk\Inventor 202x\Bin\Autodesk.Inventor.Interop.dll”
    を動的リンクするのが良いかと思ってきました。
    現在有効な(somename.iptをダブルクリックしたら起動する)Inventor.exeのpathを簡単に得る方法があれば、教えてください。
    ファイル関連付けをレジストリで追いかけるのが一番早いでしょうか。

  2. Takehiro Kato Avatar
    Takehiro Kato

    >ファイル関連付けをレジストリで追いかけるのが一番早いでしょうか。
    ご賢察の様に、レジストリ情報から取得する形となります。
    ファイルの関連付から起動されるInventorは、その端末で最後に起動されたバージョンのInventorが起動するため、外部プロセスからCOMインターフェイス経由(CreateInstance(”Inventor.Application”) 等の方法) で起動するInventorのバージョンが登録されている、以下のレジストリ配下の起動パス情報を参照いただく方法が簡便と思われます。
    HKEY_CLASSES_ROOT\CLSID\{B6B5DC40-96E3-11d2-B774-0060B0F159EF}\LocalServer32

  3. 有難うございます。
    以下のコードでdllのpathを取得できました。
    using Microsoft.Win32;
    using System.Diagnostics.CodeAnalysis;
    namespace ConsoleApp1;
    internal class Program
    {
    private static void Main(string[] args)
    {
    if (TryGetApprenticeServerDllPath(out var path))
    {
    Console.WriteLine(path);
    }
    }
    private static bool TryGetApprenticeServerDllPath([NotNullWhen(true)] out string? apprenticeServerDllPath)
    {
    apprenticeServerDllPath = null;
    try
    {
    var reg = Registry.ClassesRoot.OpenSubKey(@”CLSID\{B6B5DC40-96E3-11d2-B774-0060B0F159EF}\LocalServer32″);
    if (reg?.GetValue(null) is not string commandLine) return false;
    var inventorPath = commandLine.Split(‘/’)[0];
    var inventorDirectory = Path.GetDirectoryName(inventorPath);
    if (inventorDirectory is null) return false;
    var dllPath = Path.Combine(inventorDirectory, “Autodesk.Inventor.Interop.dll”);
    if (!File.Exists(dllPath)) return false;
    apprenticeServerDllPath = dllPath;
    return true;
    }
    catch
    {
    return false;
    }
    }
    }

Leave a Reply to Takehiro KatoCancel reply

Discover more from Autodesk Developer Blog

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

Continue reading