Command for the comparison of two project revisions.
The EPLAN.EPLAN21.REVISION.COMPARE command is called up via the API functions as specified in the EPLAN 21 API.
All parameters have the prefix "EPL_PARAM_REVISION_COMPARE"!
ParameterID | Type | Description |
---|---|---|
SOURCE | [IN] Handle |
Handle of the project or a page iterator on which the comparison is based. |
REVISION | [IN] Handle |
Project handle of the revision which is to be compared. |
OUT_DB | [IN, OPTIONAL] String |
Name of the database in which the results of the comparison are to be entered. If no parameter is indicated the database name which was used last is taken. |
CONNECTIONS | [IN, OPTIONAL] Flag |
Flag: "0": Do not compare wires (default). "1": Compare wires. |
DEVICE_TAGS | [IN, OPTIONAL] Flag |
Flag: "0": Do not compare device properties (default). "1": Compare device properties. If this value was set the properties of two identical devices contained in DEVICE_PROPITER are compared. The identity of a device is determined via its device tag. |
GRAPHIC_PROPERTIES | [IN, OPTIONAL] Flag |
Flag: "0": Do not compare graphical properties of instances (default). "1": Compare graphical properties of instances. If this value was set the properties contained in INSTANCE_PROPITER are compared. |
PAGE_PROPERTIES | [IN, OPTIONAL] Flag |
Flag: "0": Do not compare page properties (default). "1": Compare page properties. If this value was set the properties contained in PAGE_PROPITER are compared. |
INSTANCES | [IN, OPTIONAL] Flag |
Flag: "0": Do not compare insertion points of instances (default). "1": Compare insertion points of instances located on the same page. The identity of pages is determined via their names. |
DEVICE_PARTS | [IN, OPTIONAL] Flag |
Flag: "0": Do not compare part properties of devices (default). "1": Compare part properties of devices. If this value was set the properties contained in PART_PROPITER are compared. |
POTENTIAL_PROPS | [IN, OPTIONAL] Flag |
Flag: "0": Do not compare properties of potential definitions (default). "1": Compare properties of potential definitions. If this value was set the properties contained in NODE_PROPITER are compared. |
PROJECT_PARTS | [IN, OPTIONAL] Flag |
Flag: "0": Do not compare properties of project parts (default). "1": Compare properties of project parts. If this value was set the properties contained in PART_PROPITER are compared. |
SYMBOLS | [IN, OPTIONAL] Flag |
Flag: "0": Do not compare symbol properties of instances (default). "1": Compare symbol properties of instances. |
TERMINALS | [IN, OPTIONAL] Flag |
Flag: "0": Do not compare terminal properties (default). "1": Compare terminal properties. If this value was set the properties contained in DEVICE_PROPITER are compared. |
PROJECT_PROPERTIES | [IN, OPTIONAL] Flag |
Flag: "0": Do not compare project properties (default). "1": Compare project properties. |
PAGE_PROPITER | [IN, OPTIONAL] Handle |
Handle of an iterator for property definitions (EPL_ITERTYPE_PROPDEFS), which are to be used for the comparison of page properties. |
PROJECT_PROPITER | [IN, OPTIONAL] Handle |
Handle of an iterator for property definitions (EPL_ITERTYPE_PROPDEFS), which are to be used for the comparison of project properties. |
DEVICE_PROPITER | [IN, OPTIONAL] Handle |
Handle of an iterator for property definitions (EPL_ITERTYPE_PROPDEFS), which are to be used for the comparison of device properties and terminal properties. |
INSTANCE_PROPITER | [IN, OPTIONAL] Handle |
Handle of an iterator for property definitions (EPL_ITERTYPE_PROPDEFS), which are to be used for the comparison of instance properties. |
NODE_PROPITER | [IN, OPTIONAL] Handle |
Handle of an iterator for property definitions (EPL_ITERTYPE_PROPDEFS), which are to be used for the comparison of properties of potential definitions. |
PART_PROPITER | [IN, OPTIONAL] Handle |
Handle of an iterator for property definitions (EPL_ITERTYPE_PROPDEFS), which are to be used for the comparison of part properties. |
The eplExecuteCommand function returns EPL_OK if the comparison was made 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_INVALID_ARGUMENT | The SOURCE parameter is no project or page iterator. |
EPL_ERR_REVISION_EMPTY_DATABASE_NAME | The parameter OUT_DB as well as the registry entry REVISIONOUTDB are empty. |
EPL_ERR_REVISION_INVALID_DATABASE_NAME | The specified database name contains a non-existing path. |
EPL_ERR_REVISION_COMPARE | The execution of a command failed. |
EPL_ERR_REVISION_CREATE_COMMAND | The generation of a command failed. |
The following example shows a function which compares the project properties 6 (Project description) and 12 (Last editor) of two projects and which determines all modified instances.
EplHandle Compare(EplSession hSession, EplHandle hProject, EplHandle hRevision, wchar *dbOut) { EplHandle hRet(EPL_ERROR); EplHandle hCmd = eplCreateCommand(hSession, L"EPLAN.EPLAN21.REVISION.COMPARE"); if(hCmd != EPL_ERROR) { //Set parameters // // Project handle eplSetHandleParam(hSession, hCmd, EPL_PARAM_REVISION_COMPARE_SOURCE, hProject, 0); //Revision handle eplSetHandleParam(hSession, hCmd, EPL_PARAM_REVISION_COMPARE_REVISION, hRevision, 0); //Name of database: eplSetParam(hSession, hCmd, EPL_PARAM_REVISION_COMPARE_OUT_DB, dbOut, 0); //Compare project properties eplSetParam(hSession, hCmd, EPL_PARAM_REVISION_COMPARE_PROJECT_PROPERTIES, L"1", 0); //Compare instances eplSetParam(hSession, hCmd, EPL_PARAM_REVISION_COMPARE_INSTANCES, L"1", 0); //Generate iterator for property definitions EplHandle hPropIter = eplCreateEmptyIterator(m_hSession, EPL_ITERTYPE_PROPDEFS); EplHandle cmdCreateProperty = eplCreateCommand(hSession, L"EPLAN.EPLAN21.TEMPORARY_PROPERTY.CREATE"); if(cmdCreateProperty != EPL_ERROR) { //Set parameters //Property number 12 (last editor) eplSetParam(hSession, cmdCreateProperty, EPL_PARAM_TEMPORARY_PROPERTY_CREATE_ID, L"12", 0); if(eplExecuteCommand(hSession, cmdCreateProperty) == EPL_OK) { // Query result: EplHandle hPropDef = eplGetHandleParam(hSession, cmdCreateProperty, EPL_PARAM_COMMAND_RESULT, 0); //Add to iterator eplInsert(hSession, hPropIter, hPropDef); } //Set parameters //Property number 6 (project description) eplSetParam(hSession, cmdCreateProperty, EPL_PARAM_TEMPORARY_PROPERTY_CREATE_ID, L"12", 0); if(eplExecuteCommand(hSession, cmdCreateProperty) == EPL_OK) { // Query result: EplHandle hPropDef = eplGetHandleParam(hSession, cmdCreateProperty, EPL_PARAM_COMMAND_RESULT, 0); //Add to iterator eplInsert(hSession, hPropIter, hPropDef); } } //Execute command hRet = eplExecuteCommand(hSession, hCmd); //Close object eplCloseObject(hSession, hCmd); } return hRet; } |