ShapeUp Exporter Plugin Overview


General

An exporter plug-in is used to store data from ShapeUp main executable to whatever format. Data targets can be files, databases, web servers etc. An exporter plug-in is a plain DLL with a renamed extension to distinguish it from other types of plugins. The extension should be .xpr, and the file should be located in the folder <ShapeUp.exe folder>\Plugins.

Valid exporters can then be found by the user from the export dialog available from Theme|Export... menu. The name displayed here is not necessarily the same name as the .xpr file, since the display name is defined within the plug-in.

Function

The idea is that the plug-in is first initialized globally by a call to fnBatchExportBegin. Then for each layer exported, fnPreExport is called just before calls to fnExportShape for each shape in that layer. After all shapes in a layer have been successfully, or even unsuccessfully, exported, ShapeUp calls fnPostExport. When all layers are exported, ShapeUp calls fnBatchExportEnd where the exporter can clean-up its internals. This exporting process is totally synchronous, enabling state to be stored in global variables in the plug-in. Once fnBatchExportEnd returns, the plug-in is unloaded, and any state is lost.

Notice: State cannot be stored in global variables from fnSettings since the plug-in is reloaded before the actual export process begins. It is recommended that these settings are stored in the registry.

An exporter plug-in is allowed to export any number of themes in one batch. These themes doesn't have to contain the same type of shapes, even though a mix of shapes in one theme isn't permitted.


Figure 1. Export call sequence

If any of the optional functions, fnPreExport or fnPostExport, is omitted, it defaults to a true return value.

Spatial data

When exporting shapes, the exporter has full read-only access to all parts, coordinates and break points of each shape.

Attributes

When exporting shapes, the exporter has full read-only access to all attribute names, types and values.

See Also

Exporter API