Using a script to control import of network data

Using a script to more closely control the import of network data from GIS files or previously loaded GIS layers is an advanced function and should be used only by expert users with some experience of programming with a scripting language.

Import scripts can be written using VBScript. It may help to look up VBScript Tutorial or VBScript Reference on the Internet for full details of what you can do in VBScript. Please remember that VBScript is not the same as Visual Basic, Visual Basic.NET, VBScript.NET, or Visual Basic For Applications.

 You can use all the normal functionality available in VBScript to manipulate the data prior to import.

Script overview

The script contains a number of public subroutines that take the form:

OnBegin<tablename>

OnEnd<tablename>

OnBeginRecord<tablename>

OnEndRecord<tablename>

They are called as follows:

The script is executed using the Active Scripting Host. InfoWorks WS Pro looks through the list of subroutines for any of the public subroutines described above. In addition to these public subroutines, you can:

Table names

The table names are the names that appear in the Table to Import Data Into list on the Open Data Import Centre, but with any spaces in the name removed. For example

The method called after importing each record for the TransferNode table would be OnEndRecordTransferNode.

Using the public subroutines

InfoWorks WS Pro Properties and methods

There are a number of methods and properties defined by InfoWorks WS Pro that can be called by the script.

When writing the script, the properties and methods described below must be preceded by Importer. (for example Importer.MsgBox("Hello"))

Properties

Methods

Assignment methods


Open Data Import Centre dialog