EPLAN.EPLAN21.ARCHIVE.BACKUP

Contents

Description

This command archives one or several projects of a working set including their associated master data (plot frame, form, symbol files, macros, DWG files, and bitmaps) in an EPLAN archive (.ez file)

The "EPLAN.EPLAN21.ARCHIVE.BACKUP" command is called up via the API functions specified in EPLAN 21 API and is only available if the epm31.erx system expansion has been loaded.

Parameters

All parameters have the prefix "EPL_PARAM_ARCHIVE_".

The input parameter PROJECTNAMES is indexed and is to contain the project name of the respective project/projects which is/are to be saved in the archive. Index = 0 is to transfer the number of valid parameter entries.

ParameterID Type Description
NAME [IN]
String
Name of the archive file to be created.
DBHANDLE [IN]
EplHandle
Handle of the database that contains the project/s. If the parameter has not been set or is equal to -1, the first open project database is used.
PROJECTNAMES [IN, INDEX]
String
Parameter for project names the archive has to contain. Index 0 is to contain the number of valid entries of the parameter, which follow index 0.
MODE [IN]
Integer
Determines which objects of the projects or working set are to be archived, too.
(0) Only dependent (default)
(1) Bitmaps and dependent
(2) All (bitmaps and all master data)
(3) All (all master data without bitmaps)
These modes apply to projects of the entire working set. For this, DBHANDLE must be set and the PROJECTNAMES parameter must be empty
(4) Only dependent (default)
(5) Bitmaps and dependent
(6) All (bitmaps and all master data)
(7) All (all master data without bitmaps)
BLOCKSIZE [IN, OPTIONAL]
Long
Specifies the max. archive size in byte. If the value is exceeded, the archive is divided into blocks.
The minimum archive size is 1,000 kilobyte.
DESCRIPTION [IN, OPTIONAL]
String
Contains an archive description which is stored in the archive.

Error Messages

The eplExecuteCommand function returns EPL_OK if the backup could be correctly executed.

If the command fails, eplExecuteCommand returns the value EPL_ERROR. The ERROR_ID of the entries in the error log can be individually queried via the indexed parameter EPL_PARAM_COMMAND_ERROR_ID. The EPL_PARAM_COMMAND_ERROR_DESCRIPTION parameter with identical index contains an error description for the ERROR_ID.

In this case, the error log can contain the following errors:

ErrorID Description
EPL_ERR_GENERAL A system error has occurred.

Reference

Example


TCHAR buffer[512];
EplSession s = eplCreateSession();
//...
EplHandle backupCommand = eplCreateCommand(s, L"EPLAN.EPLAN21.ARCHIVE.BACKUP");

if(backupCommand != EPL_ERROR)
{
        eplSetParam(s, backupCommand, EPL_PARAM_ARCHIVE_NAME,
                       L"d:\\archive\\test.ez", 0);
	eplSetHandleParam(s, backupCommand, EPL_PARAM_ARCHIVE_DBHANDLE,
                       hDB, 0);
        eplSetParam(s, backupCommand, EPL_PARAM_ARCHIVE_PROJECTNAMES,
                       L"project1", 1);
        eplSetParam(s, backupCommand, EPL_PARAM_ARCHIVE_PROJECTNAMES,
                       L"project2", 2);
        eplSetParam(s, backupCommand, EPL_PARAM_ARCHIVE_PROJECTNAMES,
                       _ltot(2, buffer, 10), 0);
        eplSetParam(s, backupCommand, EPL_PARAM_ARCHIVE_MODE,
                       L"0", 0);
        eplSetParam(s, backupCommand, EPL_PARAM_ARCHIVE_BLOCKSIZE,
                       L"", 0);
        eplSetParam(s, backupCommand, EPL_PARAM_ARCHIVE_DESCRIPTION,
                       L"new archive", 0);

        ret = eplExecuteCommand(s, backupCommand);
}