.NET のサポートに関する注意事項

Intent 言語は、.NET API、Inventor API、独自のモジュールを含む、ルール内での直接の .NET コードの呼び出しをサポートしています。

.NET API

これは以下に示すような、即時ペインでの .NET API 呼び出しの最も単純な例です。呼び出しはシステム ネームスペースから開始する必要があります。

Intent >system.dateTime.now()
--> <5/17/2012 9:18:07 AM>
Intent >system.dateTime.now.toString()
--> "5/17/2012 9:19:05 AM"

ルールの式またはルールのボディでも同じ例を使用することができます。

Uncached Rule NowString As String = "The local time is " & system.dateTime.now.toString()

Inventor API

VBA の ThisApplication に対応する Autodesk.Intent.IntentAPI.Instance.HostAPI.HostApplication を使用して、最上位 Inventor アプリケーションにアクセスできます。ルールを作成することがこのオブジェクトを使用するための最も効率的な方法です。

Rule InventorApplication As Any = Autodesk.Intent.IntentAPI.Instance.HostAPI.HostApplication 

このルールを使用して、Inventor API 全体にアクセスできます。詳細については、「Inventor API リファレンス」を参照してください。単純な例をいくつか示します。

Intent >InventorApplication.Caption
--> "Autodesk Inventor 2012 - [Spiral Staircase.iam]"
Intent >InventorApplication.Caption = "MyApplication"
--> False
Intent >InventorApplication.ApplicationAddins
--> <System.__ComObject>
Intent >InventorApplication.ApplicationAddins.count
--> 48
注: [即時]ウィンドウから Set_ プロパティを呼び出すことはできません。値を設定するには、ルールを使用して行う必要があります。また、すべての "=" は設定ではなく等価テストとして解釈されることに注意してください。

詳細については、「Inventor ホスト API を操作する」を参照してください。

カスタム DLL

C:¥Program Files¥Autodesk¥Inventor ETO Components 20xx¥Bin のような検索パスに、使用する dll を配置します。