FileInsertDialog

The FileInsertDialog event notifies the client whenever the user executes a command for the selection and insertion of a document into another document.

Remarks

Three common commands are the Place Component command in assembly, the Derived Component command in part, and the Base View command in drawing.

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.

To change the default behavior of Inventor you need to set both the FileName and DirectoryPath to the result variable, if none are set, the behavior will stay the same.

EventNames:

  • FileInsertDialog_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 inserted 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.

Examples:

FileInsertDialog_Pre:

Register-InventorEvent -EventName FileInsertDialog_Pre -Action 'PreFileInsertDialog'

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