Arbortext Command Language > Hooks > preimporthook
  
preimporthook
preimporthook
Function prototype:
hook(arr[])
Synopsis
Use with:
add_hook(hookname, func[, prepend])
remove_hook(hookname, func)
where hookname is preimporthook.
This hook is called before the import process begins, just after the user supplies the desired parameters on the Import Document dialog box. The hook function is passed an array containing all the input parameters as specified on the document_import function (or from the dialog box), and may override the settings by altering the array. If the hook function returns -1, the import operation will be cancelled, causing document_import to return -1. If the hook modifies any of the parameters in the array, it must return 1. Otherwise, the function should return 0.
Argument
arr is an array parameter whose elements contain the document_import parameters indexed as follows:
1 — the input path name inFile
2 — the input file format inFileFmt
3 — the output path name outFile
4 — the map file path name mapFile
5 — the template file path name tmpltFile
6 — the boolean grphEntRef value
7 — the log file path name logFile
8 — the boolean batchMode value
Example
In the following example, the hook function forces the import process to use the entity method for graphics by changing the grphEntRef parameter.
function PreImportHook(arr[]))
{
arr[6] = 1;
return 1; # signal array was changed
}
add_hook("preimporthook", "PreImportHook");