LoadStateChange

The LoadStateChange event notifies the client whenever an assembly document changes its load state, i.e. goes from lite to full or from full to lite loading. _Pre fires before and _Post after the load state has changed.

EventNames:

  • LoadStateChange_Pre

  • LoadStateChange_Post

Parameters

Type

Name

Description

DocumentLoadStateEnum

newLoadState

Input DocumentLoadStateEnum value indicating the state the document is changing to when the timing kBefore and the current state when the timing is kAfter.

Remarks:

This event can be aborted by throwing an exception inside the action, but only if it is registered with the _Pre suffix.
Throwing an OperationCanceledException aborts the operation without any message.
Throwing any other exception aborts the operation and displays the thrown exception in an Error Message Box.

Examples:

LoadStateChange_Pre:

Register-InventorEvent -EventName LoadStateChange_Pre -Action 'PreLoadStateChange'

function PreLoadStateChange($newLoadState) {
	#Write event code here
}

LoadStateChange_Post:

Register-InventorEvent -EventName LoadStateChange_Post -Action 'PostLoadStateChange'

function PostLoadStateChange($newLoadState) {
	#Write event code here
}