# iLogic

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

<figure><img src="/files/sgcLZ8rJ5NNd4WkUOKRw" 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.besmart.software/t4i/commands-overview/be.smart-t4i/edit-settings/ilogic.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
