EPLAN.EPLAN21.DT.RENUMBER

Contents

Description

Command for the numbering of devices.

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

Parameters

All parameters have the prefix "EPL_PARAM_DT_RENUMBER_"!

ParameterID Type Description
CIRCUIT [IN, OPTIONAL]
EplHandle
Handle to the project/macro whose DTs are to be numbered. The parameter is optional if the parameter LOCATION is used.
LOCATION [IN, OPTIONAL]
EplHandle
Handle to a location whose DTs are to be numbered. The parameter is optional if the parameter CIRCUIT is used.
START [IN]
Integer
Starting value for numbering. Starting value has to be >= 0.
STEP [IN]
Integer
Increment for numbering. Increment has to be >= 1.
RENUMFAULTYDT [IN]
Boolean
If this flag is set, only DTs with a ? are numbered. Appropriates filter "^\\?.*" on property 1102 (code). If this flag is set, the filter for this code is overwritten.
DIRECTION [IN]
Integer
Direction of numbering. This parameter determines the direction of numbering. Possible values are:
0 - Horizontal
1 - Vertical
2 - The direction set in the plot frame is used.
FILTERIDS [IN, OPTIONAL]
Integer
In this parameter the IDs of the respective filter strings from FILTERSTRINGS are stored from index 1 on, i.e. a filter is composed of the ID and the filter string with the same index from FILTERSTRINGS.
Index 0 contains the number of filter IDs.
FILTERSTRINGS [IN, OPTIONAL]
String
In this parameter the appropriate filter-IDs from FILTERIDS are stored from index 1 on.
Index 0 contains the number of filter strings.

Error Messages

The function eplExecuteCommandreturns EPL_OK, if there has been no error while numbering the DTs.

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_START_VALUE_INVALID The START parameter has an invalid value.
EPL_ERR_STEP_VALUE_INVALID The STEP parameter has an invalid value.
EPL_ERR_START_DIRECTION_INVALID The DIRECTION parameter has an invalid value.

Example

EplSession hSession = eplCreateSession();

// ...

EplHandle hCmd = eplCreateCommand(hSession, L"EPLAN.EPLAN21.DT.RENUMBER");

// Transfer circuit/location as handle 
eplSetHandleParam(hSession, hCmd, EPL_PARAM_DT_RENUMBER_CIRCUIT, hCircuit, 0);
// Set starting value to 1
eplSetParam(hSession, hCmd, EPL_PARAM_DT_RENUMBER_START, L"1", 0);
// Set increment to 1
eplSetParam(hSession, hCmd, EPL_PARAM_DT_RENUMBER_STEP, L"1", 0);
// Set flag RENUMFAULTYDT to  0
eplSetParam(hSession, hCmd, EPL_PARAM_DT_RENUMBER_RENUMFAULTYDT, L"0", 0);
// Set direction to 1 (=vertical)
eplSetParam(hSession, hCmd, EPL_PARAM_DT_RENUMBER_DIRECTION, L"1", 0);
// Set number of filters to 2
eplSetParam(hSession, hCmd, EPL_PARAM_DT_RENUMBER_FILTERIDS, L"2", 0);
eplSetParam(hSession, hCmd, EPL_PARAM_DT_RENUMBER_FILTERSTRINGS, L"2", 0);
// Write filter ID and filter string
eplSetParam(hSession, hCmd, EPL_PARAM_DT_RENUMBER_FILTERIDS, L"768", 1);
eplSetParam(hSession, hCmd, EPL_PARAM_DT_RENUMBER_FILTERSTRINGS, L"ANLAGE", 1);
eplSetParam(hSession, hCmd, EPL_PARAM_DT_RENUMBER_FILTERIDS, L"769", 2);
eplSetParam(hSession, hCmd, EPL_PARAM_DT_RENUMBER_FILTERSTRINGS, L"ORT", 2);

// Execute
if(eplExecuteCommand(hSession, hCmd) != EPL_OK) {
        eplGetLastError();
        // Report errors....
}

Reference