Cadcorp SIS API Methods

Export Method

Description

Exports data using a Plug-in Exporter.

Syntax

Visual Basic
Public Function Export( _
   ByVal clsExport As String, _
   ByVal filename As String, _
   ByVal parameters As String _
) As Integer

Parameters

clsExport
The Plug-in Exporter class to use.
 
filename
The name of the exported file.
 
parameters

Optional parameters used to configure the Plug-in Exporter. There must be no spaces in parameters.

ArcView (*.shp)

clsExport = "AArcInfoShapeExporter"

Parameters

index=n
overlay position to export

type=n
type of data

0   Point
1   PolyLine
2   Polygon
3   MultiPoint
10 PointZ
11 PolyLineZ
12 PolygonZ
13 MultiPointZ

Example

sis.Export ("AArcInfoShapeExporter","c:\\test.shp","index=0,type=3")

AutoCAD (*.dwg)

clsExport = "DwgExporter"

Parameters

attributes=boolean

True  export attributes
False  do not export attributes

itemlayer=boolean

True  use layer name
False  use overlay name

version=n

12
13
14
2000
2004
2005
2006
2007
2008
2010
2013

TemplateFile

Path to the template file.

Note: When using a template file for export it is necessary for the 'layer' value to be set so items in SIS can be mapped onto the correct layer in AutoCad.

CopyUsedTemplateElementsOnly

True  copy elements of used template file only
False Do not use elements of used template file

xdata=boolean

True  export as Extended Data (XData)
False  do not export as Extended Data (XData)

Example

sis.Export ("DwgExporter","c:\\test.dwg","attributes=True,itemlayer=True,version=2004,
TemplateFile=c:\\Templatefile.dwg,CopyUsedTemplateElementsOnly=True,xdata=False")
Note: "version" may be AutoCAD versions 12, 13, 14, 2000, 2004, 2007

AutoCAD *.dxf

clsExport = "DxfExporter"

Parameters

attributes=boolean

True  export attributes
False  do not export attributes

itemlayer=boolean

True  use layer name
False  use overlay name

version=n

12
13
14
2000
2004
2005
2006
2007
2008
2010
2013

TemplateFile

Path to the template file.

Note: When using a template file for export it is necessary for the 'layer' value to be set so items in SIS can be mapped onto the correct layer in AutoCad.

CopyUsedTemplateElementsOnly

True  copy elements of used template file only
False Do not use elements of used template file

xdata=boolean

True  export as Extended Data (XData)
False  do not export as Extended Data (XData)

Examples

Note: The attributes and xdata parameters are mutually exclusive, so do not use both parameters in the same export command line:

sis.Export("DxfExporter","C:\\test.dxf","attributes=true,itemlayer=true,version=13")

or

sis.Export("DxfExporter","C:\\test.dxf","xdata=true,itemlayer=true,version=13")

TemplateFile=c:\\Templatefile.dxf,CopyUsedTemplateElementsOnly=True,xdata=True")

Note: "version" may be AutoCAD versions 12, 13, 14, 2000, 2004/05/06, 2007/08, 2010, 2013.

Example using a template file:

sis.Export ("DxfExporter","c:\\test.dxf","attributes=True,itemlayer=True,version=2013,TemplateFile=c:\\Templatefile.dxf,
CopyUsedTemplateElementsOnly=True")

ESRI BIL *.bil

clsExport = "BILGridExporter"

Parameters

showerrors=boolean

True  show errors encountered in the export
False  don’t show errors

Note

Only grid items can be exported.

Example

sis.Export ("BILGridExporter "," c:\\test.bil","showerrors=True")

EuroNAV *.gxf

clsExport = "AGxfExporter"

Parameters

none

Notes

The coordinate reference system must be set to latitude and longitude.

Example

sis.Export ("AGxfExporter","c:\\test.gxf","")

 

Geographic Markup Language *.gml & *.gz

clsExport = "AGMLExporter"
export a GML file as plain text XML

clsExport = "AGMLExporter3_2_1"
export a GML 3.2.1 file as plain text XML

clsExport = "AGMLExporterGZ"
export a GML file in ZIP format

clsExport = "AGMLExporter3_2_1GZ"
export a GML 3.2.1 file in ZIP format

Parameters

index=n
overlay position to export

namespaceUri=nsUri
the name space URI

namespacePrefix=nsP
the name space prefix

Notes

The namespaceUri must be enclosed within double quotes. The export will also create the corresponding XML schema definition file, e.g. test.gml and test.xsd.

Example

sis.Export ("AGMLExporter","c:\\test.gml", "index=2")
sis.Export ("AGMLExporterGZ","c:\\test.gz", "index=2,namespaceUri=""
http://www.myorg.com"",namespacePrefix=myspace")

GeoJSON

clsExport = "GeoJSONFeaturesExporter"

Parameters

ExportSchema = True | False

True  exported property values will be controlled by the Overlay Schema
False  exported property values will be per-Item

Google Earth *.kmz

clsExport = "KMZExporter"

Parameters

Note: "dataelements": "fieldnames", "description", "ignoretransparency", "simulatemlpens", "tessalate" = "true" or "false" or true or false, are recognised as strings and booleans.

altitudeMode (String) = clampedtoground | relativetoground | absolute
Altitude settings

fieldnames (Boolean) = True | False
Export feature attributes as KML Descriptions?

description (Boolean) = True | False
Include fieldnames in description?

namefieldidx (Integer)
Index of the schema column to use for naming, starting at 0, there is no default index value

Extrusionfieldidx (Integer)
This defines the index of the schema column to use for extruding the height of exported items, starting at 0.

ignoretransparency (Boolean) = True | False
Ignore brush transparency

simulatemlpens (Boolean) = True | False
Simulate multi-level pens using KML Folders?

tesselate (Boolean) = True | False
Tesselate LineStrings?

overlay (Integer)
The overlay position to export, starting at 0. There is no default index value.

Use SchemaData elements (i.e. structured data) Use Data elements (i.e. unstructured data)

extrusionfieldidx=-1

Example

This example shows all the individual parameters concatenated into one string called "sparams". That string is then passed on to SIS.Export:

Dim ignoretransparency As String = "false"
   Dim simulatemlpens As String = "false"
   Dim description As String = "true"
   Dim fieldnames As String = "true"
   Dim schemadata As String = "false"
   Dim dataelements As String = "true"
   Dim altitudemode As String = "clampedToGround"
   Dim extrusionfieldidx As Integer = 0
   Dim tesselate As String = "false"
   Dim overlay As Integer = 0
   Dim namefieldidx As Integer = 0

   Dim sparams As String = "altitudemode =" & altitudemode & " ,
fieldnames =" & fieldnames & ", schemadata =" & schemadata & ", 
dataelements =" & dataelements & ", namefieldidx=" & namefieldidx & ",
description =" & description & ",ignoretransparency =" & ignoretransparency & ",
simulatemlpens =" & simulatemlpens & ", tesselate =" & tesselate & ", 
overlay =" & overlay & ", extrusionfieldidx =" & extrusionfieldidx

sis.Export ("KMZExporter","c:\\test.kmz", sparams)

Note: The coordinate reference system of the view must be in Latitude/Longitude.OGC.WGS_1984.

MapInfo *.mif

clsExport = "AMapInfoExporter"

Parameters

index=n
the overlay position to export

width=n
the width of char column. The default is 30.

Example

sis.Export ("AMapInfoExporter","c:\\test.mif","index=1,width=30")

MapInfo *.tab

clsExport = "ATabExporter"

Parameters

index=n
the overlay position to export. There is no default index value.

width=n
width of char column, or a comma delimited string of column names (where the char field names are followed by a space and the width of the column). There is no default width value.

Examples

sis.Export ("ATabExporter","c:\\test.tab","index=1,width=30")
sis.Export ("ATabExporter","c:\\test.tab","index=1;Description 30,Item_ID, Item_class 10,Origin_x,Origin_y,Origin_z")

Note: The field names list after the semicolon in the second example must match the schemas definition in SIS. Also, field names can only contain letters, numbers and '_'. They cannot contain spaces and punctuation marks and they cannot begin with a number. The only spaces allowed are between the character field name and its width specification.

MicroStation V8 *.DGN

clsExport = "DGNdirectExporter"

Parameters

itemlayer: bool (optional)
explodeblocks: bool (optional)
attributes: bool (optional)
version: string of 'DGN7' or 'DGN8' optional. The plugin currently only supports DGN8.

Example

sis.Export ("DGN8Exporter","c:\\test.dgn","")

Oracle

clsExport = "OracleSpatialExporter"
clsExport = "OracleNetworkExporter"

 

OracleSpatialExporter

Parameters

Parameter Type Comments
user String the id with which to log in to Oracle
password String password for id
server String the server hosting the Oracle database
layer String the spatial table in Oracle to export to
geometry String the column in the Oracle table which stores the geometry
varcharlen Integer the maximum number of characters that can be stored in the column
overlay Integer overlay position to export
dimension Integer 2 = export data are two dimensional, 3 =export data are three dimensional
srid Integer Oracle’s spatial reference identifier, use 81989 for OSGB
action Integer 0 = create a new table, 1 = append to an existing table
createIndex Boolean True = create a spatial index, False = do not create a spatial index

OracleNetworkExporter

params$=

"connection=""OCI:service=YOURserver;user=YOURuser;password=YOURpassword""

showerrors=true|false

network=YOURnetworkname

overlaylink=3(layer number)

overlaynode=3(layer number)

srid=81989 (Spatial reference identifier, use EPSG code 27700 for OSGB)

sparameters = "connection=""OCI:service=spatial_qaserver;user=tempuser;password=SPATIAL"",network=qatest, overlaylink=3,overlaynode=3,srid=81989"

        sis.Export("OracleNetworkExporter", "", sparameters)

Note

The Oracle spatial exporter defaults to database type "text" for strings

Example

Dim params As String
params = "user=MYLOGIN,password=MYPWD,server=MYDBSVR,Layer=MYTABLE,varcharlen=50,overlay=0"
sis.Export ("OracleSpatialExporter","",params)


PostGIS

clsExport = "APostGISExporter"

Parameters

user=uid
the ID with which to log in to PostGIS

password=pwd
password for the uid

host=n
the name, or IP address, of the server hosting the database

port=p
the port to which the database listens, set during installation

database=d
the name of the database

layer=l
the spatial table in PostGIS to export to

geometry=c
the column in the PostGIS table which stores the geometry

geometryid="gid" (optional)
change the default name of the PostGIS Table Primary Key

varcharlen=n
the maximum number of characters that can be stored in the column

overlay=o
overlay position to export

dimension=n

2 export two dimensional data
3 export three dimensional data

srid=srid
spatial reference identifier, use EPSG code 27700 for OSGB

action=n

0 create a new table
1 append to an existing table

createIndex=boolean

True   create a spatial index 
False do not create a spatial index

showerrors=boolean

True  show errors encountered in the export
False  don’t show errors

Notes

srid must be specified if action = 0 or is omitted

The PostGIS exporter defaults to database type "text" for strings

Example

Dim params As String
params = "user=MYLOGIN,password=MYPWD,host=MYDBSVR,port=5432,database=MYDB,layer=MYTABLE,_
varcharlen=50,overlay=0,srid=27700,action=0,createIndex=True,showerrors=true"
sis.Export ("APostGISExporter ","",params)

Scalable Vector Graphics *.svg

clsExport = "SvgExporter"
export a file in plain text XML format

clsExport = "SvgExporterZipped"
export a file in ZIP format

Parameters

metadatacolumns=l
l is a list of schema columns to include as metadata. Use * for all columns.

Example

sis.Export ("SvgExporter ","c:\\test.svg","")
sis.Export ("SvgExporterZipped","c:\\test.svgz","metadatacolumns=*")

SED Export

clsExport = "ASisExporter"

Parameters

none

Example

sis.Export ("ASisExporter", "c:\\test.sed","")

Notes

Other third party exporters may be available. Consult your supplier for information on these.

SQL Exporter

clsExport = "SQLServerExporter"

Parameters

Connection:string, the full ADO connection string
showerrors: boolean, True - show errors in message boxes
table: string, the target table name
geometry: string, that target geometry column name
featureid: string, the target feature id column name
overlay: integer, the index of the overlay being exported
createindex: boolean, True - create a spatial index
boundingbox: boolean, True - use the Overlay bounding box, False - use the CRS bounding box (when creating the spatial index)”

The connection string should be in JSON format.

Examples

sis.Export ("SQLServerExporter", "", Params)

sis.Export ("SQLServerExporter", "","connection=""Server=it-gis\sqlexpress; Database=TestGIS; User ID=user; Password=Pword;"", showerrors=True,table=MyTable,geometry=SP_GEOMETRY,FEATUREID=MI_TEST,overlay=1,createindex=True,boundingbox=True")

Remarks

Available: GEO MM ME MD OD OM SISpy

Groups:


Send comments on this topic.

Click to return to www.cadcorp.com

© Copyright 2000-2017 Computer Aided Development Corporation Limited (Cadcorp).