Command for inserting a dimensioning line into a page.
The EPLAN.EPLAN21.DIMENSION.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 of the page into which the dimensioning line is to be inserted. | ||||||||||||||||||||||||||||||||||||||||||||||||
XPOS | [IN] Integer |
X-coordinate of the starting point of the dimensioning line. | ||||||||||||||||||||||||||||||||||||||||||||||||
YPOS | [IN] Integer |
Y-coordinate of the starting point of the dimensioning line. | ||||||||||||||||||||||||||||||||||||||||||||||||
DELTA_X | [IN] Integer |
Distance between the starting point and the end point of the dimensioning line on the x-axis | ||||||||||||||||||||||||||||||||||||||||||||||||
DELTA_Y | [IN] Integer |
Distance between the starting point and the end point of the dimensioning line on the y-axis | ||||||||||||||||||||||||||||||||||||||||||||||||
PENWIDTH | [IN] Integer |
Pen width | ||||||||||||||||||||||||||||||||||||||||||||||||
COLOR | [IN, OPTIONAL] Integer |
Color of the dimensioning line and of the text:
|
||||||||||||||||||||||||||||||||||||||||||||||||
STYLE | [IN, OPTIONAL] Integer |
Line style:
|
||||||||||||||||||||||||||||||||||||||||||||||||
FONT | [IN, OPTIONAL] Integer |
Character set ID (default = 0) | ||||||||||||||||||||||||||||||||||||||||||||||||
FONT_SIZE | [IN] Integer |
Font size display size[mm] = FONT_SIZE * 25,4[mm] / 10000 |
||||||||||||||||||||||||||||||||||||||||||||||||
FONT_JUSTIFY | [IN, OPTIONAL] Integer |
Font justification:
|
||||||||||||||||||||||||||||||||||||||||||||||||
RESULT | [OUT] EplHandle |
After execution of the command, this parameter can be used to query the handle of the created dimensioning line. |
The eplExecuteCommand function returns EPL_OK if the dimensioning line 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 dimensioning line 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 a dimensioning line into a page. The handle to the page object must be determined first.
EplHandle createDimension(EplSession s, EplHandle page) { EplHandle hRet(EPL_ERROR); //Create command EplHandle cmdCreateDimension = eplCreateCommand(s, L"EPLAN.EPLAN21.DIMENSION.CREATE"); if(cmdCreateDimension != EPL_ERROR) { //Set parameters // //Page handle eplSetHandleParam(s, cmdCreateDimension, EPL_PARAM_GRAPHIC_CREATE_PAGE, page, 0); //Pen size eplSetParam(s, cmdCreateDimension, EPL_PARAM_GRAPHIC_CREATE_PENWIDTH, L"1", 0); //Pen color eplSetParam(s, cmdCreateDimension, EPL_PARAM_GRAPHIC_CREATE_COLOR, L"7", 0); //X/Y coordinates of line start eplSetParam(s, cmdCreateDimension, EPL_PARAM_GRAPHIC_CREATE_XPOS, L"100000", 0); eplSetParam(s, cmdCreateDimension, EPL_PARAM_GRAPHIC_CREATE_YPOS, L"100000", 0); //X/Y gradient eplSetParam(s, cmdCreateDimension, EPL_PARAM_GRAPHIC_CREATE_DELTA_X, L"10000", 0); eplSetParam(s, cmdCreateDimension, EPL_PARAM_GRAPHIC_CREATE_DELTA_X, L"10000", 0); //Font eplSetParam(s, cmdCreateDimension, EPL_PARAM_GRAPHIC_CREATE_FONT, L"0", 0); eplSetParam(s, cmdCreateDimension, EPL_PARAM_GRAPHIC_CREATE_FONT_SIZE, L"2500", 0); eplSetParam(s, cmdCreateDimension, EPL_PARAM_GRAPHIC_CREATE_FONT_JUSTIFY, L"5", 0); //Execute command if(eplExecuteCommand(s, cmdCreateDimension) = EPL_OK) { // Query result: hRet = eplGetHandleParam(s, cmdCreateDimension, EPL_PARAM_GRAPHIC_CREATE_RESULT, 0); } eplCloseObject(s, cmdCreateDimension); } return hRet; } |