Miglioramenti di iLogic

Informazioni sui nuovi miglioramenti di iLogic in questa release di Inventor.

Supporto iLogic per l'evento Prima dell'archiviazione in Vault

Un nuovo evento denominato Prima dell'archiviazione in Vault è stato aggiunto alla finestra di dialogo "Trigger di evento". Ciò consente di eseguire un controllo finale dei file prima che vengano inviati a Vault.

È possibile scrivere una regola che esegua un controllo e imposti un flag per annullare il processo di archiviazione. Se un gruppo di file, ad esempio i file primari o derivati, viene archiviato insieme e uno dei file viene annullato, non verrà archiviato alcun file. Di seguito è riportato un codice di esempio come riferimento:

    Dim checkIn = RuleArguments.VaultCheckIn
        If checkIn.InProgress Then
            If String.IsNullOrEmpty(iProperties.Value("Project", "Stock Number")) Then
                        checkIn.Cancel = True
                        checkIn.ReasonsForCancel.Add("The Stock Number iProperty is empty.")
            End If
        End If
\```

If a rule that runs on an event throws an error, the check-in is cancelled, and you must fix the error before proceeding with the check-in. If there is a failure in a parent file (for example, an assembly), the check-in for the child files (such as parts) is also cancelled, and vice versa. If an external rule is attached to the event and that external rule is not found when the check-in occurs, then the check-in will be cancelled. An error in a single file cancels the entire check-in operation.

A rule executing on this event must treat the file as read-only. Once saved, the file is prepared for check-in. While the rule can verify values, it cannot modify them.



<!--MD
<div class="card-thumbnail">
MD-->


![Markdown card metadata](../../../../../images/wn2025_ilogic_vault_check_in.png)



<!--MD
</div>
MD-->


For more information, see [To Work with Event Triggers in iLogic](topicid=GUID-B14A47F4-81D2-4627-A973-2BC7F790DF89).

![](../../../../../images/inv_ideas_icon_TX-35x35.png) [**An Inventor® Ideas submission**](https://forums.autodesk.com/t5/inventor-ideas/ilogic-events-trigger-before-check-in/idi-p/5701514)

![](../../../../../images/inv_ideas_icon_TX-35x35.png) [**An Inventor® Ideas submission**](https://forums.autodesk.com/t5/inventor-ideas/check-in-as-an-event-trigger-for-ilogic-rules/idc-p/11268532#M45738)

## iLogic Support for Control of the Edit Scope with Model States

Use the snippets to control editing for Model States.

![](../../../../../images/wn2025_ilogic_model_states_scope.png)

![](../../../../../images/inv_ideas_icon_TX-35x35.png) [**An Inventor® Ideas submission**](https://forums.autodesk.com/t5/inventor-ideas/provide-the-ability-to-edit-multiple-model-states/idi-p/11140182)

![](../../../../../images/inv_ideas_icon_TX-35x35.png) [**An Inventor® Ideas submission**](https://forums.autodesk.com/t5/inventor-ideas/ilogic-api-get-document-of-each-model-state-without-activation/idi-p/10343165)

## Ability to Choose Image Files for Ribbon Buttons

In the "Options" tab of the Rule editor (for an external rule), the current icons are displayed. Clicking on the folder button will open a file dialog where you can select another bitmap file from any folder. The file you select will be copied to the same folder as the rule, with the name changed to follow the naming convention. The recommended resolution for the image (in pixels) is 16x16 for small and 32x32 for large. However, other sizes will be automatically scaled.

![](../../../../../images/wn2025_ilogic_select_icons.png)

## Enable iLogic security scanning of rules by default

The "Inspect rules for malicious code" option is now checked by default after the installation. This option can be accessed from either of the following:

- Event Triggers dialog > Options
- Tools tab > iLogic > iLogic Configuration > Security Options

![](../../../../../images/wn2025_ilogic_inspect_rules.png)

## Technology Enhancements

The latest version of the syntax editor for editing rules is now available, along with the latest version of .NET used to compile rules.