Command for compressing projects and macros.
The EPLAN.EPLAN21.CIRCUIT.COMPRESS command is called up via the API functions as specified in the EPLAN 21 API.
All parameters have the prefix "EPL_PARAM_COMPRESSCIRCUIT_"!
ParameterID | Type | Description |
---|---|---|
CIRCUIT | Handle[IN] | Handle of the project/macro. |
DEVICETAG | String[IN, OPTIONAL] |
This flag controls whether empty device tags are to be removed.
"1" = Remove unused device tags. (default = 0). |
SYMBOLFILE | String[IN, OPTIONAL] |
This flag controls whether unused symbol files are to be removed from the project/macro.
"1" = Remove unused symbol files. (default = 0). |
PAGEBREAKS | String[IN, OPTIONAL] |
This flag controls whether empty interruption-point lists are to be removed.
"1" = Remove unused interruption-point lists. (default = 0). |
ERRORLOGS | String[IN, OPTIONAL] |
This flag controls whether error logs are to be deleted.
"1" = Delete error log. (default = 0). |
DELNONINSTCOMPS | String[IN, OPTIONAL] |
This flag controls whether non-instantiated components are to be deleted.
"1" = Delete non-instantiated components. (default = 0). |
DELSELCONTACTOR | String[IN, OPTIONAL] |
This flag controls whether contacts and coils of contactors with contactor selection are also to be deleted. This flag has no function unless DELNONINSTCOMPS has been set. "1" = Edit contactor with contactor selection. (default = 0). |
DELUNDEFPINS | String[IN, OPTIONAL] |
This flag controls whether non-instantiated pins are to be deleted in case of undefined plugs. This flag has no function unless DELNONINSTCOMPS has been set. "1" = Delete pins in case of undefined plugs. (default = 0). |
DELCABLELINES | String[IN, OPTIONAL] |
This flag controls whether non-instantiated cable lines are to be deleted. This flag has no function unless DELNONINSTCOMPS has been set. "1" = Delete non-instantiated cable lines. (default = 0). |
RESULT | String[OUT] | If the project/macro cannot be compressed any further this will be noted in this parameter after the execution of the command. |
The eplExecuteCommand function returns EPL_OK if the project/macro could be compressed with error messages.
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_NO_RIGHT | The current user group is not allowed to modify projects/macros. |
EPL_ERR_FAILED | Compressing failed. |
EPL_ERR_INVALID_ARGUMENT | One or several parameters are invalid. |
The following example shows a function that uses this command.
EplHandle compress(EplSession hSession, EplHandle hCircuit) { EplHandle hRet(EPL_ERROR); EplHandle hCmd = eplCreateCommand(hSession, L"EPLAN.EPLAN21.CIRCUIT.COMPRESS"); if(hCmd != EPL_ERROR) { eplSetHandleParam(hSession, hCmd, EPL_PARAM_COMPRESSCIRCUIT_CIRCUIT, hCircuit, 0); eplSetParam(hSession, hCmd, EPL_PARAM_COMPRESSCIRCUIT_SYMBOLFILE, L"1", 0); eplSetParam(hSession, hCmd, EPL_PARAM_COMPRESSCIRCUIT_PAGEBREAKS, L"1", 0); eplSetParam(hSession, hCmd, EPL_PARAM_COMPRESSCIRCUIT_ERRORLOGS, L"1", 0); eplSetParam(hSession, hCmd, EPL_PARAM_COMPRESSCIRCUIT_DELNONINSTCOMPS, L"1", 0); eplSetParam(hSession, hCmd, EPL_PARAM_COMPRESSCIRCUIT_DELSELSCHUETZ, L"1", 0); eplSetParam(hSession, hCmd, EPL_PARAM_COMPRESSCIRCUIT_DELUNDEFPINS, L"1", 0); eplSetParam(hSession, hCmd, EPL_PARAM_COMPRESSCIRCUIT_DELCABLELINES, L"1", 0); hRet = eplExecuteCommand(hSession, hCmd); eplCloseObject(hSession, hCmd); } return hRet; } |