When the program is driven from an automation script, an options string can be specified in the script that acts as the import options dialogs do in the program. The string consists of comma-separated parameters, which specify the behavior of the various import options.
Parameter |
Type |
Description |
Filter |
string |
SHP |
AreasToCurves |
0, 1 |
Whether to set all polygons to polylines. 0 does not set all polygons to polylines. 1 doesset all polygons to polylines. |
ImportCodePage |
integer |
The number of the ANSI code page to use when importing Unicode data. Valid code page number in the range 0 through 65535.
If a .CPG file exists in the directory with the same name as the .SHP file, the code page stored in the .CPG file will be used.
If a .DBF file exists in the directory with the same name as the .SHP file, the .DBF file attribute data must be translated from ANSI text to Unicode representation. If no .CPG file exists, the Language ID value stored in the .DBF file's header determines the code page used. However, if the Language ID value is zero or invalid, the "Western European (Windows)" code page (1252) will be used. |
Example
This example shows how to import a SHP file with the various options.
CommandApi.Construct("Import")
CommandApi.Option("GuiEnabled", "False")
CommandApi.Option("AutoConnect", "True")
CommandApi.Option("ClearOptions", "False")
CommandApi.Option("Filter", "shp")
CommandApi.Option("Options", "AreasToCurves=1")
CommandApi.Option("Path", "C:/Path/To/Import/file.shp")
CommandApi.Option("PersistOptions", "True")
CommandApi.Do()
Used by: Import
See Also