FileInsertNewDialog
The FileInsertNewDialog event notifies the client whenever the user executes the Create Component command within an assembly.
Remarks
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.
If the TemplateFileName is not set the default template will be used. To set the Template file name you will need to set both the TemplateFileName and TemplateDirectoryPath properties.
EventNames:
FileInsertNewDialog_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 |
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, can be used to check that the fileName set is correct. |
String |
TemplateFileName |
The filename of the file to use as the template when creating the new component. |
String |
TemplateDirectoryPath |
The directory of the file to use as the template when creating the new component. |
String |
TemplateFullFileName |
The full file name of the template file, can be used to check that the fileName set is correct |
Examples:
FileInsertNewDialog_Pre:
Register-InventorEvent -EventName FileInsertNewDialog_Pre -Action 'PreFileInsertNewDialog'
function PreFileInsertNewDialog($templateDirectory, $result) {
#Write event code here
$result.FileName = "12345.ipt"
$result.DirectoryPath = "C:\\Vault"
$result.FullFileName #Returns the FullFileName e.g "C:\\Vault\12345.ipt" , cannot be set.
$result.TemplateFileName = "template.ipt"
$result.TemplateDirectoryPath = "C:\\Templates"
$result.TemplateFullFileName #Returns the TemplateFullFileName e.g "C:\\Templates\template.ipt", cannot be set.
}