Command for deleting a part.
The EPLAN.EPLAN21.PART.DELETE command is called up via the API functions as specified in the EPLAN 21 API.
All parameters have the prefix "EPL_PARAM_PART_DELETE_".
ParameterID | Type | Description |
---|---|---|
PART | [IN] EplHandle |
Handle of the part to be deleted. |
The eplExecuteCommand function returns EPL_OK if the part could be successfully deleted.
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 delete a part. |
EPL_ERR_FAILED | The part could not be deleted. |
EPL_ERR_INVALID_ARGUMENT | The parameter PART is not of the type Part. |
The following example shows a function which deletes a part. If successful, the return value of the function is EPL_OK, otherwise EPL_ERROR.
EplHandle deletePart(EplSession s, EplHandle hPart) { EplHandle hRet(EPL_ERROR); if(hComponent) { //Create command EplHandle cmdDeletePart(eplCreateCommand(sSession, L"EPLAN.EPLAN21.PART.DELETE)); if(cmdCreatePart != EPL_ERROR) { //Set parameters eplSetHandleParam(sSession, cmdDeletePart, EPL_PARAM_PART_DELETE_PART, hPart, 0); //Execute command hRet = eplExecuteCommand(sSession, cmdDeletePart); eplCloseObject(sSession, cmdDeletePart); } } return hRet; } |