iLogic 增強功能

瞭解此版 Inventor 中的新 iLogic 改進。

對「在 Vault 入庫納管之前」事件的 iLogic 支援

在「事件觸發器」對話方塊中,加入一個名為「在 Vault 入庫納管之前」的新事件。它可讓您在將檔案提交至 Vault 之前,對檔案執行最終檢查。

您可以編寫一個規則,以執行檢查,並為取消入庫納管程序設定旗標。如果一組檔案 (例如父系或子系檔案) 正在一起入庫納管,然後您取消其中一個檔案的入庫納管,則不會入庫納管任何檔案。以下是供參考的範例程式碼:

    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.