EnvironmentChange

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
}