This command creates an ellipse on a page.
The EPLAN.EPLAN21.ELLIPSE.CREATE command is called up via the API functions as specified in the EPLAN 21 API.
All parameters have the prefix "EPL_PARAM_GRAPHIC_CREATE_".
ParameterID | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PAGE | [IN] EplHandle |
Handle to the page into which the ellipse is to be inserted. | ||||||||||||||||||||||||||||||||||||||||||||||||
XPOS | [IN] Integer |
X-coordinate of the insertion point of the ellipse. | ||||||||||||||||||||||||||||||||||||||||||||||||
YPOS | [IN] Integer |
Y-coordinate of the insertion point of the ellipse. | ||||||||||||||||||||||||||||||||||||||||||||||||
PENWIDTH | [IN] Integer |
Pen width for the object perimeter. | ||||||||||||||||||||||||||||||||||||||||||||||||
DELTA_X | [IN] Integer |
Main axis of the ellipse. | ||||||||||||||||||||||||||||||||||||||||||||||||
DELTA_Y | [IN] Integer |
Secondary axis of the ellipse. | ||||||||||||||||||||||||||||||||||||||||||||||||
ANGLE | [IN, OPTIONAL] Float |
Rotation angle of the ellipse in degrees (default=0), | ||||||||||||||||||||||||||||||||||||||||||||||||
FILL | [IN, OPTIONAL] Integer |
Flag:
| ||||||||||||||||||||||||||||||||||||||||||||||||
COLOR | [IN, OPTIONAL] Integer |
Line color:
|
||||||||||||||||||||||||||||||||||||||||||||||||
STYLE | [IN, OPTIONAL] Integer |
Line style:
|
||||||||||||||||||||||||||||||||||||||||||||||||
RESULT | [OUT] EplHandle |
After execution of the command, this parameter can be used to query the handle of the created ellipse. |
The eplExecuteCommand function returns EPL_OK if the ellipse 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 ellipse could not be created. |
EPL_ERR_INVALID_ARGUMENT | The PAGE parameter is not an object of the Page type. |
The following example shows a function which inserts an ellipse into a page. The handle to the page object must be determined first.
EplHandle createEllipse(EplSession s, EplHandle page) { EplHandle hRet(EPL_ERROR); //Create command EplHandle cmdCreateEllipse = eplCreateCommand(s, L"EPLAN.EPLAN21.ELLIPSE.CREATE"); if(cmdCreateEllipse != EPL_ERROR) { //Set parameters // //Page handle eplSetHandleParam(s, cmdCreateEllipse, EPL_PARAM_GRAPHIC_CREATE_PAGE, page, 0); //Pen size eplSetParam(s, cmdCreateEllipse, EPL_PARAM_GRAPHIC_CREATE_PENWIDTH, L"1", 0); //Pen color eplSetParam(s, cmdCreateEllipse, EPL_PARAM_GRAPHIC_CREATE_COLOR, L"7", 0); //x-y-coordinates of the insertion point of the ellipse eplSetParam(s, cmdCreateEllipse, EPL_PARAM_GRAPHIC_CREATE_XPOS, L"100000", 0); eplSetParam(s, cmdCreateEllipse, EPL_PARAM_GRAPHIC_CREATE_YPOS, L"100000", 0); //Radius of ellipse x-direction eplSetParam(s, cmdCreateEllipse, EPL_PARAM_GRAPHIC_CREATE_DELTA_X, L"10000", 0); //Radius of ellipse y-direction eplSetParam(s, cmdCreateEllipse, EPL_PARAM_GRAPHIC_CREATE_DELTA_Y, L"5000", 0); //Execute command if(eplExecuteCommand(s, cmdCreateEllipse) = EPL_OK) { // Query result: hRet = eplGetHandleParam(s, cmdCreateEllipse, EPL_PARAM_GRAPHIC_CREATE_RESULT, 0); } eplCloseObject(s, cmdCreateEllipse); } return hRet; } |