EPLAN.EPLAN21.ARC.CREATE

Contents

Description

Command for inserting an arc into a page.

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

Parameters

All parameters have the prefix "EPL_PARAM_GRAPHIC_CREATE_".

ParameterID Type Description
PAGE [IN]
EplHandle
Handle of the page into which the arc is to be inserted.
XPOS [IN]
Integer
X coordinate of arc center.
YPOS [IN]
Integer
Y coordinate of arc center.
PENWIDTH [IN]
Integer
Pen width for arc perimeter.
ANGLE1 [IN, OPTIONAL]
Float
Start angle of arc in degrees (default = 0).
ANGLE2 [IN, OPTIONAL]
Float
End angle of arc in degrees (default = 0).
DELTA_X [IN]
Integer
Radius of arc.
COLOR [IN, OPTIONAL]
Integer

Line color:

0 = Black (default)
1 = Red
2 = Yellow
3 = Green
4 = Cyan
5 = Blue
6 = Magenta
7 = White
8 = Gray
9 = Red 50%
10 = Yellow 50%
11 = Green 50%
12 = Cyan 50%
13 = Blue 50%
14 = Magenta 50%
15 = Violet
STYLE [IN, OPTIONAL]
Integer

Line style:

0 = continuous (default)
1 = dashed
2 = dotted
3 = dash-dotted
4 = dash-dot-dotted
5 = none
can be combined with:
32 = arrow at the beginning
64 = arrow at the end
96 = arrow at both sides
RESULT [OUT]
EplHandle
After execution of the command, this parameter can be used to query the handle of the created arc object.

Error Messages

The eplExecuteCommand function returns EPL_OK if the arc could be successfully inserted into the page.

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 page.
EPL_ERR_FAILED The arc 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 an arc into a page. The handle to the page object must be determined first.

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

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

        if(cmdCreatePie != EPL_ERROR)
        {
                //Set parameters
                //
                //Page handle
                eplSetHandleParam(s,
                                  cmdCreatePie,
                                  EPL_PARAM_GRAPHIC_CREATE_PAGE,
                                  page,
                                  0);

                //Pen size
                eplSetParam(s,
                            cmdCreatePie,
                            EPL_PARAM_GRAPHIC_CREATE_PENWIDTH,
                            L"1",
                            0);

                //Pen color
                eplSetParam(s,
                            cmdCreatePie,
                            EPL_PARAM_GRAPHIC_CREATE_COLOR,
                            L"7",
                            0);

                //X/Y coordinates of arc center
                eplSetParam(s,
                            cmdCreatePie,
                            EPL_PARAM_GRAPHIC_CREATE_XPOS,
                            L"100000",
                            0);

                eplSetParam(s,
                            cmdCreatePie,
                            EPL_PARAM_GRAPHIC_CREATE_YPOS,
                            L"100000",
                            0);

                //Radius
                eplSetParam(s,
                            cmdCreatePie,
                            EPL_PARAM_GRAPHIC_CREATE_DELTA_X,
                            L"10000",
                            0);

                //Start angle
                eplSetParam(s,
                            cmdCreatePie,
                            EPL_PARAM_GRAPHIC_CREATE_ANGLE1,
                            L"45.0",
                            0);

                //End angle
                eplSetParam(s,
                            cmdCreatePie,
                            EPL_PARAM_GRAPHIC_CREATE_ANGLE2,
                            L"90.0",
                            0);

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

                eplCloseObject(s, cmdCreatePie);
        }

        return hRet;
}

Reference