# iLogic

This tool allows configuring iLogic rules that will be executed when some application events happen.

<figure><img src="https://4060565498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL8qMZuBhZUXGRVospdct%2Fuploads%2FDwP8eROsu2ygEM7ZEhMN%2Fimage.png?alt=media&#x26;token=cb41ad43-2558-4d42-afe5-8f3d5be7076a" alt=""><figcaption></figcaption></figure>

Sections 1 to 5 allow users to pair the application events and iLogic rules that should be executed on the application events. The iLogic rules can be of the following two types:

* full path to an external ilogic rule,
* name of the iLogic rule imported to an external rules list.

Samples of rules that can handle those application events are available in the installation path of T4I:

* `c:\ProgramData\Autodesk\ApplicationPlugins\Holixa.Tools4Inventor.bundle\Samples\iLogic`

The sample rules have the following naming scheme:

* `HolixaT4I_AutoRule_<NameOfEvent>.iLogicVb`

## Event Enhancement

With these event handlers, you can use additional information to 'enhance' the default (built-in) iLogic event handlers. Below are the code samples showing what information is available and links to Autodesk Inventor API reference for more information.

### AfterNew

```vbnet
Dim TemplateFileName As String = RuleArguments("TemplateFileName")
Dim NewFileName As String = RuleArguments("NewFileName")
```

For more information, see the [ApplicationEvents.OnNewDocument Event](https://help.autodesk.com/view/INVNTOR/2023/ENU/?guid=GUID-F42EE4DF-0479-433B-8760-DEC5A6F802C2) web page.

### AfterOpen

```vbnet
Dim FullDocumentName As String = RuleArguments("FullDocumentName")
Dim TopLevelFilename As String = RuleArguments("TopLevelFilename")
```

For more information, see the [ApplicationEvents.OnOpenDocument Event](https://help.autodesk.com/view/INVNTOR/2023/ENU/?guid=GUID-5BC3333D-2E8C-4670-B4E6-D1491FA9CB05) web page.
