NewDocument

The NewDocument event notifies the client whenever a new document is created based on a template. _Pre fires before and _Post after the document is created.
The file name of a new document is usually not set until it is saved for the first time. An exception is the Create Component command in an assembly, where the file name is specified as part of the command.

EventNames:

  • NewDocument_Pre

  • NewDocument_Post

Parameters

Type

Name

Description

Document

document

Object that was just created. This is only available in the Post event, as in Pre, the document does not yet exist.

Examples:

NewDocument_Pre:

Register-InventorEvent -EventName NewDocument_Pre -Action 'PreNewDocument'

function PreNewDocument() {
	#Write event code here
}

NewDocument_Post:

Register-InventorEvent -EventName NewDocument_Post -Action 'PostNewDocument'

function PostNewDocument($document) {
	#Write event code here
}