FileNew

The FileNew event fires before a new file is created from a standard template (File New). This is for example the case when the document type is selected from the pop-up list next to the New command; the Create New File dialog is bypassed then, so [FileNewDialog](<</code_reference/objects/inventor_event_mappings/fileui_events/filenewdialog>) is not triggered.

EventNames:

  • FileNew_Pre

Parameters

Type

Name

Description

DocumentTypeEnum

documentType

DocumentTypeEnum indicating the document type

Remarks:

This event can be aborted by throwing an exception inside the action.
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:

FileNew_Pre:

Register-InventorEvent -EventName FileNew_Pre -Action 'PreFileNew'

function PreFileNew($documentType) {
	#Write event code here
}