Command for reading the information associated with an archive.
The "EPLAN.EPLAN21.ARCHIVE.READ_INFO" 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.
All parameters have the prefix "EPL_PARAM_ARCHIVE_".
The output parameter PROJECTNAMES is indexed and after the execution it contains the respective file name of the project/projects which is/are contained in the specified archive. Index = 0 indicates the number of projects contained in the archive as it is also done by the output parameter COUNTERPROJECTS.
ParameterID | Type | Description |
---|---|---|
NAME | [IN] String |
Name of archive file |
PROJECTNAMES | [OUT, INDEX] String |
If reading is successful, this parameter contains the file names of the projects contained in the archive. Index 0 indicates the number of valid entries of the parameter, which follow index 0. |
COUNTBLOCKS | [OUT] Integer |
If reading is successful, this parameter contains the number of archive blocks. |
COUNTPROJECTS | [OUT] Integer |
If reading is successful, this parameter contains the number of the projects contained in the archive. |
DESCRIPTION | [OUT] String |
If reading is successful, this parameter contains the description of the archive. |
USERNAME | [OUT] String |
If reading is successful, this parameter contains the name of the user who has created the archive. |
STATIONNAME | [OUT] String |
If reading is successful, this parameter contains the name of the computer on which the archive was created. |
DATABASE | [OUT] String |
If reading is successful, this parameter contains the name of the database from which the archive was created. |
DATE | [OUT] String |
If reading is successful, this parameter contains the creation date of the archive. |
The eplExecuteCommand function returns EPL_OK if all information in the specified archive could be read correctly.
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. |
TCHAR buffer[512]; EplSession s = eplCreateSession(); //... EplHandle hcmdReadArchivInfo = eplCreateCommand(hSession, L"EPLAN.EPLAN21.ARCHIVE.READ_INFO"); if(hcmdReadArchivInfo != EPL_ERROR) { eplSetParam(s, hcmdReadArchivInfo, EPL_PARAM_ARCHIVE_NAME, L"d:\\archive\\test.ez", 0); if(eplExecuteCommand(s, hcmdReadArchivInfo) != EPL_ERROR) { eplGetParam(s, hcmdReadArchivInfo, EPL_PARAM_ARCHIVE_USERNAME, 0, buffer, 512); ... eplGetParam(s, hcmdReadArchivInfo, EPL_PARAM_ARCHIVE_STATIONNAME, 0, buffer, 512); ... eplGetParam(s, hcmdReadArchivInfo, EPL_PARAM_ARCHIVE_DATE, 0, buffer, 512); ... eplGetParam(s, hcmdReadArchivInfo, EPL_PARAM_ARCHIVE_DESCRIPTION, 0, buffer, 512); ... eplGetParam(s, hcmdReadArchivInfo, EPL_PARAM_ARCHIVE_DATABASE, 0, buffer, 512); ... eplGetParam(s, hcmdReadArchivInfo, EPL_PARAM_ARCHIVE_COUNTBLOCKS, 0, buffer, 512); long blockCount = _ttoi(buffer); ... eplGetParam(s, hcmdReadArchivInfo, EPL_PARAM_ARCHIVE_PROJECTNAMES, 0, buffer, 512); long count = _ttoi(buffer); for(long ii = 1; ii <= count; ii++) { eplGetParam(s, hcmdReadArchivInfo, EPL_PARAM_ARCHIVE_PROJECTNAMES, ii, buffer, 512); ... } } } |