A Note on .NET Support

The Intent language supports calling .NET code directly in rules, including calling the .NET API, the Inventor API, and your own module.

.NET API

This is the simplest example of a .NET API call in the Immediate pane, as shown below. Calls must start from the System namespace.

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

You can use the same example in a rule formula or rule body:

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

Inventor API

You can access the top level Inventor application object with Autodesk.Intent.IntentAPI.Instance.HostAPI.HostApplication, which corresponds to ThisApplication in VBA. Creating a rule is the most efficient way to use this object:

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

With this rule you can access the entire Inventor API. Refer to the Inventor API Reference for details. Here are some simple examples:

Intent >InventorApplication.Caption
--> "Autodesk Inventor 2012 - [Spiral Staircase.iam]"
Intent >InventorApplication.Caption = "MyApplication"
--> False
Intent >InventorApplication.ApplicationAddins
--> <System.__ComObject>
Intent >InventorApplication.ApplicationAddins.count
--> 48
Note: You cannot call Set_ properties from the Immediate window. In order to Set a value, you must do it with a rule. Also, note that all "=" are interpreted as an equals test, not a set.

See Interacting with the Inventor Host API for more information.

Custom DLLs

Place your dll in the search path, like C:\Program Files\Autodesk\Inventor ETO Components 20xx\Bin.