User Interface Events

The EnvironmentChange event notifies the client when the active environment switches from one environment to another, regardless of what caused the change. _Pre fires before and _Post after the environment change.
Each environment change triggers the event four times: before and after for the environment that was active and is suspended or terminated, and before and after for the environment that becomes active.
An environment is tied to a particular document. If two part documents are open, each has its own Part environment, so switching between them also triggers the event.

EventNames:

  • EnvironmentChange_Pre

  • EnvironmentChange_Post

Parameters

Type

Name

Description

EnvironmentStateEnum

environmentState

Indicates the transition state the environment is going through.

Examples:

EnvironmentChange_Pre:

Register-InventorEvent -EventName EnvironmentChange_Pre -Action 'PreEnvironmentChange'

function PreEnvironmentChange($environmentState) {
	#Write event code here
}

EnvironmentChange_Post:

Register-InventorEvent -EventName EnvironmentChange_Post -Action 'PostEnvironmentChange'

function PostEnvironmentChange($environmentState) {
	#Write event code here
}

The ResetRibbonInterface event notifies the client when the ribbon user interface is reset. Only _Post is available.

EventNames:

  • ResetRibbonInterface_Post

Examples:

ResetRibbonInterface_Post:

Register-InventorEvent -EventName ResetRibbonInterface_Post -Action 'PostResetRibbonInterface'

function PostResetRibbonInterface() {
	#Write event code here
}

The ResetEnvironments event notifies the client when environments are reset in the Environments tab of the Customize dialog, using the Reset button (selected environment) or the Reset All button (all environments). An environment is set back to its default state; it is not deleted. Only _Post is available.

EventNames:

  • ResetEnvironments_Post

Remarks:

The end-user resets environments using the “Reset” and “Reset All” buttons on the Environments tab of the Customize dialog:

  • The “Reset” button on the Environments tab will cause this notification to be sent for the currently selected environment.

  • The “Reset All” button causes this notification to be sent where the Environments argument will contain all of the existing environments.

When an environment is reset it is set back to the default state, but the environment is not deleted. The primary use of this notification is to allow add-ins to reconfigure their environments after a reset has occurred.

Examples:

ResetEnvironments_Post:

Register-InventorEvent -EventName ResetEnvironments_Post -Action 'PostResetEnvironments'

function PostResetEnvironments() {
	#Write event code here
}

The ResetShortcuts event notifies the client when command shortcuts/aliases are reset in the Customize dialog, using the Reset All Keys or the Reset All button. Only _Post is available.

EventNames:

  • ResetShortcuts_Post

Examples:

ResetShortcuts_Post:

Register-InventorEvent -EventName ResetShortcuts_Post -Action 'PostResetShortcuts'

function PostResetShortcuts() {
	#Write event code here
}