FileNewDialog

The FileNewDialog event notifies the client when the user executes the New or Create Drawing View command to create a new file, at the point where Inventor would display the Create New File dialog to select a template.
The event is not triggered if the dialog is bypassed, for example when the document type is selected from the pop-up list next to the New command (see [FileNew](<</code_reference/objects/inventor_event_mappings/fileui_events/filenew>)).

EventNames:

  • FileNewDialog_Pre

Parameters

Type

Name

Description

String

templateDirectory

The default template directory as defined in the File tab of the Application Options dialog.

ResultParameters

result

Object used to supply the result of the operation. See below.

Result properties:

Type

Name

Description

String

TemplateFileName

The filename of the file to use as the template when creating the new file.

String

TemplateDirectoryPath

The directory of the file to use as the template when creating the new file.

String

TemplateFullFileName

The full file name of the template file, can be used to check that the fileName set is correct

Remarks:

If the end-user uses the pop-up command list next to the New command to select an assembly, part, presentation, or drawing document, the Create New File dialog is bypassed and this notification is not sent in this case.

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:

FileNewDialog_Pre:

Register-InventorEvent -EventName FileNewDialog_Pre -Action 'PreFileNewDialog'

function PreFileNewDialog($templateDirectory, $result) {
	#Write event code here
	$result.TemplateFileName = "template.ipt"
	$result.TemplateDirectoryPath = "C:\Templates"
	$result.TemplateFullFileName #Returns the TemplateFullFileName e.g "C:\Templates\template.ipt", cannot be set.
}