EPLAN.EPLAN21.REVISION.CREATE

Contents

Description

Command for generating a revision.

The EPLAN.EPLAN21.REVISION.CREATE command is called up via the API functions as specified in the EPLAN 21 API.

Parameters

All parameters have the prefix "EPL_PARAM_REVISION_CREATE"!

ParameterID Type Description
PROJECT [IN]
Handle
Handle of the project of which a revision is to be generated.
NAME [IN, OPTIONAL]
String
Name of the revision to be generated.
If no parameter is indicated the name created from the format string EPL_PROPERTY_PROJ_REVISION_NAME_FORMAT is used. (Property <2306>).
COMMENT [IN, OPTIONAL]
String
Comment on the revision. The comment is saved in the property EPL_PROPERTY_PROJ_REVISION_COMMENT of the revision. (Property <2308>).
SNAPSHOT [IN, OPTIONAL]
Flag
Flag:
"0": A normal write-protected revision is generated (default).
"1": A temporary revision is generated which can be deleted at any time.
REVISION [OUT]
String
Contains the handle of the generated revision if the command was successfully executed.

Error Messages

The eplExecuteCommand function returns EPL_OK if the revision was generated successfully..

If the command fails, eplExecuteCommand returns the value EPL_ERROR. In this case, the error log can contain the following errors:

ErrorID Description
EPL_ERR_REVISION_CREATE_NAME No name was given for the revision, and the format property EPL_PROPERTY_PROJ_REVISION_NAME_FORMAT is not set.
EPL_ERROR_REVISION_EASY Import/export of the project failed.
EPL_ERR_NO_RIGHT The current user group does not have the rights to carry out the import/export of EASY-files.
IDS_ERR_EXECUTE_CMD The execution of an API command failed.

Example

The following example shows a function which creates a revision of a project. The return value contains the handle of the revision

EplHandle
CreateRevision(EplSession s, EplHandle hProject, wchar_t *RevisionName)
{
        EplHandle hRet(EPL_ERROR);
        EplHandle hRevision(EPL_ERROR);

        EplHandle hCmd = eplCreateCommand(s, L"EPLAN.EPLAN21.REVISION.CREATE");

        if(hCmd != EPL_ERROR)
        {
                //Set parameters
                //
                // Project handle
                eplSetHandleParam(s, hCmd, EPL_PARAM_REVISION_CREATE_PROJECT, hProject, 0);

                //Name of revision
                eplSetParam(s, hCmd, EPL_PARAM_REVISION_CREATE_NAME, RevisionName, 0);

                //Execute command
                hRet = eplExecuteCommand(s, hCmd);

                if(hRet != EPL_ERROR)
                {
                    hRevision = eplGetHandleParam(s, hCmd, EPL_PARAM_REVISION_CREATE_REVISION, 0);
                }

                //Close object
                eplCloseObject(s, hCmd);
        }

        return hRevision;
}

Reference