This example utility file runs three processes. The first opens the selection in CARIS Easy ViewTM, the second uses a Windows command to create a copy of a file and opens it, and the third lists the files in the current working directory in the Output window.
<Utilities> |
<Utility Version="1"> |
<Name>Open selection in Easy View</Name> |
<Tooltip>Open the selection and superselection in Easy View</Tooltip> |
<Command>"C:\Program Files\CARIS\Easy View\4.1\Bin\CARISEasyView.exe" %SelectionFile% %SuperSelectionFile%</Command> |
<SelectionFile> |
<FileType>hob</FileType> |
<FileName>AnyName.hob</FileName> |
<FilePath>D:\Temp</FilePath> |
</SelectionFile> |
<SuperSelectionFile> |
<FileType>gml</FileType> |
<FileName>AnyName.gml</FileName> |
<FilePath>D:\Temp</FilePath> |
</SuperSelectionFile> |
</Utility> |
|
<Utility Version="1"> |
<Name>Open a copy of the selection</Name> |
<Tooltip>Saves the selection, uses the OS to copy it, and opens the copy</Tooltip> |
<Command>cmd.exe /c copy %SelectionFile% %ReturnFile%</Command> |
<SelectionFile> |
<FileType>hob</FileType> |
<FileName>AnyName.hob</FileName> |
<FilePath>D:\Temp</FilePath> |
</SelectionFile> |
<ReturnFile> |
<FileName>CopiedFeature.hob</FileName> |
<FilePath>D:\Temp</FilePath> |
</ReturnFile> |
</Utility> |
|
<Utility Version="1"> |
<Name>List folder contents</Name> |
<Tooltip>List contents of current working directory in the output window</Tooltip> |
<Command>cmd.exe /c dir/w</Command> |
<CommandOutput> |
<OutputWindow>true</OutputWindow> |
</CommandOutput> |
</Utility> |
</Utilities> |
This table describes each of the tags that can be used in utilities.xml.
Tag | Description |
<Name> | The name of the utility to be displayed in the Utilities toolbar. |
<Tooltip> | A description of the currently selected utility to be displayed in the Status bar when the cursor is over the Utilities toolbar. |
<Command> | The full external process to be run, including any necessary parameters. Certain special keywords represent both a file path and name passed to the external process and also a command to the original application, including: • %SelectionFile% - the selection is to be exported by the current application • %SuperselectionFile% - the superselection is to be exported by the current application • %ReturnFile% - the current application will open this file once the external process is complete |
<CommandBlock> | An optional way to block the current application until the external process is complete. There are two possible values for this tag: True (block the application) or False (allow application to continue). Note that the current application is always blocked if %ReturnFile% is used in the <Command> section. |
<CommandOutput> | A parent container for the child elements that define how to display text produced by the external process. |
<OutputFile> | A complete filename and path if text produced by the external process is to be output to a log file. |
<OutputWindow> | Text produced by the external process is to be logged in the current application's Output window. |
<SelectionFile> | A parent container for the child elements that describe how to export the selection. This includes the <FilePath>, <FileName> and <FileType>. This is only used if %SelectionFile% is used in the <Command> section. |
<SuperselectionFile> | A parent container for the child elements that describe how to export the superselection. This includes the <FilePath>, <FileName> and <FileType>. This is only used if %SuperselectionFile% is used in the <Command> section. |
<ReturnFile> | A parent container for the child elements that define how the external process will create the file to be opened by the current application when the external process is complete. This includes the <FilePath>, <FileName> and <FileType>. This is only used if %ReturnFile% is used in the <Command> section. |
<FileType> | This can be HOB, GML, or SHP. |
<FileName> | The filename, including the extension. |
<FilePath> | The complete file path to the folder location of the resulting file. |