EPLAN.EPLAN21.ARCHIVE.READ_PROJECTFILES

Contents

Description

Command for reading the project dependencies in an EPLAN archive.

In an EPLAN archive (.ez file), several projects incl. their master data and bitmaps (dependencies) can be stored in compressed format (gz format). This command can now be used for determining the project dependencies in an archive which are required for restoring.

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

Parameters

All parameters have the prefix "EPL_PARAM_ARCHIVE_".

ParameterID Type Description
NAME [IN]
String
Name of the archive whose project dependencies are to be determined in the archive.
PROJECTNAMES [IN, index, OPTIONAL]
String
Parameter for the names of the projects whose dependencies are to be determined. The command expects a file name without a path (e.g. test.prj). Index 0 is to contain the number of valid entries of the parameter, which follow index 0.
FORMNAMES [OUT, index]
String
Parameter for the names of the forms that were stored in the archive project-dependently. Index 0 contains the number of entries of the parameter, which follow index 0.
FRAMENAMES [OUT, index]
String
Parameter for the names of the plot frames that were stored in the archive project-dependently. Index 0 contains the number of entries of the parameter, which follow index 0.
SYMBOLFILENAMES [OUT, index]
String
Parameter for the names of the symbol files that were stored in the archive project-dependently. Index 0 contains the number of entries of the parameter, which follow index 0.
MACRONAMES [OUT, index]
String
Parameter for the names of the macros that were stored in the archive project-dependently. Index 0 contains the number of entries of the parameter, which follow index 0.
BITMAPNAMES [OUT, index]
String
Parameter for the names of the bitmaps, incl. directory specification, that were stored in the archive project-dependently. Index 0 contains the number of entries of the parameter, which follow index 0.
DWGFILENAMES [OUT, index]
String
Parameter for the DWG files that were stored in the archive project-dependently. Index 0 contains the number of entries of the parameter, which follow index 0.

Error Messages

The eplExecuteCommand function returns EPL_OK if the restoring 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.

Example


TCHAR buffer[512];
EplSession s = eplCreateSession();
//...

EplHandle cmd = eplCreateCommand(s, L"EPLAN.EPLAN21.ARCHIVE.READ_PROJECTFILES");

if(cmd != EPL_ERROR)
{
        eplSetParam(s, cmd, EPL_PARAM_ARCHIVE_NAME,
                       L"d:\\archive\\test.ez", 0);

        eplSetParam(s, restoreCommand, EPL_PARAM_ARCHIVE_PROJECTNAMES,
                       L"project1.prj", 1);

        eplSetParam(s, restoreCommand, EPL_PARAM_ARCHIVE_PROJECTNAMES,
                        _ltot(1, buffer, 10), 0);

        if(eplExecuteCommand(s, cmd) != EPL_ERROR)
        {
                eplGetParam(s, cmd, EPL_PARAM_ARCHIVE_FORMNAMES, 0, buffer, 512);
                long ii, count = _ttoi(buffer);
                CString fileName;
                for(ii = 1; ii <= count; ii++)
                {
                        eplGetParam(s, cmd, EPL_PARAM_ARCHIVE_FORMNAMES, ii, buffer, 512);
                        fileName = CString(buffer);
                        ...
                }
                eplGetParam(s, cmd, EPL_PARAM_ARCHIVE_FRAMENAMES, 0, buffer, 512);
                count = _ttoi(buffer);
                for(ii = 1; ii <= count; ii++)
                {
                        eplGetParam(s, cmd, EPL_PARAM_ARCHIVE_FRAMENAMES, ii, buffer, 512);
                        fileName = CString(buffer);
                        ...
                }
                eplGetParam(s, cmd, EPL_PARAM_ARCHIVE_SYMBOLFILENAMES, 0, buffer, 512);
                count = _ttoi(buffer);
                for(ii = 1; ii <= count; ii++)
                {
                        eplGetParam(s, cmd, EPL_PARAM_ARCHIVE_SYMBOLFILENAMES, ii, buffer, 512);
                        fileName = CString(buffer);
                        ...
                }
                eplGetParam(s, cmd, EPL_PARAM_ARCHIVE_MACRONAMES, 0, buffer, 512);
                count = _ttoi(buffer);
                for(ii = 1; ii <= count; ii++)
                {
                        eplGetParam(s, cmd, EPL_PARAM_ARCHIVE_MACRONAMES, ii, buffer, 512);
                        fileName = CString(buffer);
                        ...
                }
                eplGetParam(s, cmd, EPL_PARAM_ARCHIVE_BITMAPNAMES, 0, buffer, 512);
                count = _ttoi(buffer);
                for(ii = 1; ii <= count; ii++)
                {
                        eplGetParam(s, cmd, EPL_PARAM_ARCHIVE_BITMAPNAMES, ii, buffer, 512);
                        fileName = CString(buffer);
                        ...
                }
                eplGetParam(s, cmd, EPL_PARAM_ARCHIVE_DWGFILENAMES, 0, buffer, 512);
                count = _ttoi(buffer);
                for(ii = 1; ii <= count; ii++)
                {
                        eplGetParam(s, cmd, EPL_PARAM_ARCHIVE_DWGFILENAMES, ii, buffer, 512);
                        fileName = CString(buffer);
                        ...
                }
        }
}

Reference