EPLAN.EPLAN21.WIRE.CREATE

Contents

Description

Command for inserting a network wire into a network.

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

A network wire is a wire which is only evaluated if the EPL_PROPERTY_PROJ_NETWIRES project property was set. Network wires are offline wires.

Parameters

All parameters have the prefix "EPL_PARAM_WIRE_CREATE_".

ParameterID Type Description
NET [IN]
EplHandle
Handle of the network (net) of the new wire.
CONNECTION_POINT1 [IN]
EplHandle
Handle of the first connection of the new wire.
CONNECTION_POINT2 [IN]
EplHandle
Handle of the second connection of the new wire.
PROJECT [IN]
EplHandle
Handle of the project of the network of the new wire.
RESULT [OUT]
EplHandle
After the command was successfully executed, this property can be used to query the handle of the inserted wire.

Error Messages

The eplExecuteCommand function returns EPL_OK if the wire could be successfully inserted into the project.

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 the project.
EPL_ERR_FAILED The component could not be created.
EPL_ERR_INVALID_ARGUMENT The PAGE parameter is not an object of the Page type.

Example

The following example shows a function which inserts a wire into a network.

EplHandle
createComponent(EplSession session,
                EplHandle net,
                EplHandle connectionPoint1,
				EplHandle connectionPoint2,
                EplHandle project)
{
        EplHandle hRet(EPL_ERROR);

        //Create command
        EplHandle cmdCreateWire = eplCreateWire(session, L"EPLAN.EPLAN21.WIRE.CREATE");

        if(cmdCreateWire != EPL_ERROR)
        {
                //Set parameters
                //1.Set page handle
                eplSetHandleParam(s,
                                  cmdCreateWire,
                                  EPL_PARAM_WIRE_CREATE_NET,
                                  net,
                                  0);

                eplSetParam(s,
                            cmdCreateWire,
                            EPL_PARAM_WIRE_CREATE_CONNECTION_POINT1,
                            connectionPoint1,
                            0);

                eplSetParam(s,
                            cmdCreateWire,
                            EPL_PARAM_WIRE_CREATE_CONNECTION_POINT2,
                            connectionPoint2,
                            0);

                eplSetParam(s,
                            cmdCreateWire,
                            EPL_PARAM_WIRE_CREATE_PROJECT,
                            project,
                            0);

                //Execute command
                if(eplExecuteCommand(s, cmdCreateWire) == EPL_OK)
                {
                        // Query result:
                        hRet = eplGetHandleParam(s,
                                            cmdCreateWIRE,
                                            EPL_PARAM_WIRE_CREATE_RESULT,
                                            0);
                }

                eplCloseObject(s, cmdCreateComponent);
        }

        return hRet;
}

Reference