Creating a New Basemap Add In
Creating your own add in requires that you manually edit the AddInConfig.xml file, and create the associated script. This file is used to populate the list of add ins available from the shortcut and Selection menus, and points to the script used to open the accessory application and populate the data.
Editing AddInConfig.xml
The file AddInConfig.xml, stored in the AddIns folder within the Support folder of your SeisWare installation, is used to name the option as it will appear in the Add Ins menu on the shortcut and Selection menus, and provides the file location of the application associated with the add in, as well as the location of the associated script when required.
To add an add in to this file you will need to provide several attributes to an application node:
- Name: The name of the add in as it will appear in the Add Ins menu in the Basemap.
- Location: The location of the application that should be run. If the application exists somewhere in the system path, then the full path does not need to be provided.
- CmdLine: The command line parameters for the application. There are several substitution variables that are available.
- The $dir substitution variable will replace the $dir variable with the AddIns directory under the SeisWare Support folder.
- The $file substitution variable will replace the $file variable with the name of the temporary XML file that is generated by the add in.
You also need to add a DataType node to specify the type of data you are retrieving. By default, all of the data associated with the data type will be exported to the XML file to be passed to another application. If you only require specific data, you can also provide a Field node. A full list of allowable Field attributes can be found here. Valid DataType values are:
- well
- seismi3d
- seismic2d
- grid
- culture
- fault
- raster
- custom
If the XML file is not in the required format for your application, you will have to write a script to transform it into what is required.
Example
The following example of an AddInConfig.xml file references two applications (Internet Explorer and AccuAudit).
<?xml version="1.0" encoding="utf-8"?>
<AddInApplicationConfig>
<Application Name="View Wells" Location="iexplore" CmdLine="&file">
<DataType Name="well" />
</Application>
<Application Name="AccuAudit" Location="WSCRIPT" CmdLine=""$dir\accuAudit.js" /dataFile:"$file" /directory:"$dir"">
<DataType Name="well" />
<DataType Name="custom" />
</Application>
</AddInApplicationConfig>
View Wells and AccuAudit will appear in the Add Ins menu when you right click on a well on the Basemap, as indicated by the Name attribute. Notice that the first configured application (View Wells) will open the temporary XML file (indicated by the $file substitution variable) in Internet Explorer, and that no additional scripts are required. The second configured application (AccuAudit) uses the WSCRIPT command, and the command line references the script stored in the AddIns directory (indicated by $dir\accuAudit.js), and the temporary XML file (indicated by the $file substitution variable). Additional applications can easily be added to this file using the same nomenclature.
To create a script file to reconfigure the XML data file and run the selected application, you probably need some previous scripting knowledge. You can use the accuAudit.js script, location in the AddIns folder, as an example. Any files you create should also be saved to the AddIns folder for easy reference.
— MORE INFORMATION
Copyright © 2020 | SeisWare International Inc. | All rights reserved |