EPLAN.EPLAN21.TEMPORARY_PROPERTY.CREATE

Contents

Description

Command for creating a temporary property.

A temporary property can for instance be used as parameter for a command. An iterator for properties can e.g. be assigned to the EPLAN.EPLAN21.PAGE.CREATE command. This iterator can then be filled with properties generated from this command.

Parameters

All parameters have the prefix "EPL_PARAM_TEMPORARY_PROPERTY_CREATE_"!

ParameterID Type Description
ID [IN]
Integer
ID of the property which is to be generated.
IDX [IN, OPTIONAL]
Integer
Index of the generated property. The default value is 0.
VALUE [IN, OPTIONAL]
String
Contents of the property which is to be generated.
EPL_PARAM_COMMAND_RESULT [OUT]
EplHandle
Handle of the generated property.

Error Messages

The eplExecuteCommand function returns EPL_OK if the property was generated 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 EPL_PARAM_TEMPORARY_PROPERTY_CREATE_ID parameter was invalid.

Example

The following example shows a function which generates a property with ID 768, index 0, and value ANLAGE.

EplHandle
createProperty(EplSession s, EplHandle page)
{
        EplHandle hRet(EPL_ERROR);

        //Create command
        EplHandle cmdCreateProperty = eplCreateCommand(s, L"EPLAN.EPLAN21.TEMPORARY_PROPERTY.CREATE");

        if(cmdCreateProperty != EPL_ERROR)
        {
                //Set parameters
                //
                //ID
                eplSetParam(s,
                                  cmdCreateProperty,
                                  EPL_PARAM_TEMPORARY_PROPERTY_CREATE_ID,
                                  "768",
                                  0);

                //Index
                eplSetParam(s,
                            cmdCreateProperty,
                            EPL_PARAM_TEMPORARY_PROPERTY_CREATE_IDX,
                            L"0",
                            0);

                //Value
                eplSetParam(s,
                            cmdCreateProperty,
                            EPL_PARAM_TEMPORARY_PROPERTY_CREATE_VALUE,
                            L"ANLAGE",
                            0);

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

                eplCloseObject(s, cmdCreateProperty);
        }

        return hRet;
}

Reference