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.