FileOpenDialog

The FileOpenDialog event notifies the client when the user executes the Open command to open an existing file, at the point where Inventor would display the Open dialog.
The event is not triggered if the Open dialog is bypassed, for example when a file is opened from the most recently used list (see [FileOpenFromMRU](<</code_reference/objects/inventor_event_mappings/fileui_events/fileopenfrommru>)).

EventNames:

  • FileOpenDialog_Pre

Parameters

Type

Name

Description

ResultParameters

result

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

Result properties:

Type

Name

Description

String

FileName

The file name to use.

String

DirectoryPath

The directory where the file that should be opened is in.

String

FullFileName

The full file name of the file that will be used. Can be used to check that the set file name is correct.

Remarks:

By using this event and setting a fileName and directoryPath to the result variable, the user can replace the default Inventor behavior, normally used to replace the Inventor dialog with their own dialog.

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:

FileOpenDialog_Pre:

Register-InventorEvent -EventName FileOpenDialog_Pre -Action 'PreFileOpenDialog'

function PreFileOpenDialog($result) {
	#Write event code here
	$result.FileName = "12345.ipt"
	$result.DirectoryPath = "C:\Vault"
	$result.FullFileName # C:\Vault\12345.ipt
}