TerminateDocument

The TerminateDocument event notifies the client when a document is terminated, i.e. completely closed. Terminating a document is the counterpart of initializing it (see [InitializeDocument](<</code_reference/objects/inventor_event_mappings/application_events/initializedocument>)). _Pre fires before and _Post after the document is terminated.

EventNames:

  • TerminateDocument_Pre

  • TerminateDocument_Post

Parameters

Type

Name

Description

String

fullDocumentName

Output string that specifies the fully qualified name of the document being terminated. This is supplied both before and after.

Document

document

Document object that is being terminated. This is only available in the Pre event, as in the Post event the document is no longer available.

Examples:

TerminateDocument_Pre:

Register-InventorEvent -EventName TerminateDocument_Pre -Action 'PreTerminateDocument'

function PreTerminateDocument($fullDocumentName, $document) {
	#Write event code here
}

TerminateDocument_Post:

Register-InventorEvent -EventName TerminateDocument_Post -Action 'PostTerminateDocument'

function PostTerminateDocument($fullDocumentName) {
	#Write event code here
}