Area Export

A SIS ActiveX (Viewer, Manager or Modeller level) utility program that exports a list of item (e.g. room) areas from a set of SWD files. This program has no Windows user interface and may be run from a command prompt, or batch file, or by using a Windows Shortcut. The following alternative command line arguments are required, enclosed in double quotes if they include a space character. File names may include a folder path, absolute or relative to the current folder.

AreaExport <overlay> <code_property> <swd_list_file> <result_file>
AreaExport <overlay> <code_property> <swd_list_file> INSERT|UPDATE|UPDATE_OR_INSERT <odbc_dsn> <table> <code_column> <area_column>
where:
<overlay>is the name of an overlay in each SWD containing the area items.
<code_property>is the name of an item string property containing area identifiers (e.g. room codes).
<swd_list_file>is the name of a file containing a list of SWD file names.
<result_file>is the name of a file for the results, this will be overwritten if it already exists.
INSERTspecifies that results are created in a database as new rows.
UPDATEspecifies that results are created in a database as updates to existing rows.
UPDATE_OR_INSERTspecifies that results are created in a database as updates to existing rows, otherwise as new rows.
<odbc_dsn>is the name of an ODBC Data Source for the database.
<table>is the name of the database table to be updated.
<code_column>is the name of the table column for area identifiers (e.g. room codes).
<area_column>is the name of the table column for the area results.

Note that for UPDATE_OR_INSERT all columns other than the code and area columns must either permit null values or have default values.

A log of activity, errors and statistics is appended to the file AreaExport.log in the current folder, this file is created if it does not already exist.

Configuration

Area Export reads the following settings from the file AreaExport.exe.config in the same folder as AreaExport.exe. The order of parameters is not significant unless one is repeated, when the last occurrence is used. Setting a parameter to an empty value is the same as omitting the parameter. Use a plain text editor such as Notepad to change settings to suit your environment.

KeyValue
CadcorpLicenceServer The name or IP address of the Cadcorp licence server, or no-net to specify a local licence. Optional, if omitted a local licence will be used if present, otherwise the server specified in Windows environment variable CADCORP_LICENCE_SERVER_LIST, otherwise a server obtained by network broadcast.

Test Data

The following test files are included:

AreaExport.txtList of SWD file names
A2.swdSWD file
P01BS04.swdSWD file
AreaExport.mdbMicrosoft Access database

Log File

Following is a brief log example using the test data, and an ODBC DSN named SISfm-AreaExport connected to AreaExport.mdb:

17/02/2015 6:24:27 PM AreaExport Space   RLOC AreaExport.txt AreaExport.csv
17/02/2015 6:24:37 PM SWD "P01BS04.swd" contains 47 areas totalling 474.176
17/02/2015 6:24:37 PM SWD "junk.swd" can not be opened
17/02/2015 6:24:39 PM SWD ".\A2.swd" does not contain overlay "Space"
17/02/2015 6:24:39 PM Total of 47 areas totalling 474.176 in 1 SWD files
17/02/2015 6:24:39 PM AreaExport Terminating
17/02/2015 6:26:00 PM AreaExport ASPACE2 RLOC AreaExport.txt AreaExport.csv
17/02/2015 6:26:02 PM SWD "P01BS04.swd" does not contain overlay "ASPACE2"
17/02/2015 6:26:02 PM SWD "junk.swd" can not be opened
17/02/2015 6:26:05 PM SWD ".\A2.swd" contains 169 areas totalling 3,075.932
17/02/2015 6:26:05 PM Total of 169 areas totalling 3,075.932 in 1 SWD files
17/02/2015 6:26:05 PM AreaExport Terminating
17/02/2015 6:30:17 PM AreaExport ASPACE2 RLOC AreaExport.txt INSERT SISfm-AreaExport AreaExport RLOC Area
17/02/2015 6:30:20 PM SWD "P01BS04.swd" does not contain overlay "ASPACE2"
17/02/2015 6:30:20 PM SWD "junk.swd" can not be opened
17/02/2015 6:30:23 PM Error Executing: INSERT INTO AreaExport (RLOC,Area) VALUES ('PA2400',1.602)
17/02/2015 6:30:23 PM SWD ".\A2.swd" contains 169 areas totalling 3,075.932
17/02/2015 6:30:23 PM Total of 169 areas totalling 3,075.932 in 1 SWD files
17/02/2015 6:30:23 PM AreaExport Terminating