.. highlightlang:: us .. index:: OBJSetRefPointWC .. _objsetrefpointwc: OBJSetRefPointWC ================ .. us.tag OBJSetRefPointWC ENGLISH draw-set :ref:`OBJSetRefPointWC` specifies, to which corner of the object the position coordinates refer. .. function:: bool = OBJSetRefPointWC(hobj, nRefPointWC) .. us.return **Return Value** *bool* is TRUE (1) if the function was successful, and FALSE (0) if an error occurred. .. us.params **Parameters** .. uparam:: hobj *hobj* identifies the text, rectangle or ellipse object. .. uparam:: nRefPointWC *nRefPointWC* is an OR combination of two of the following values: .. list-table:: :header-rows: 1 * - Name - Value - Meaning * - LEFT - 4 - Left corner. * - CENTER - 2 - Center between left and right corner. * - RIGHT - 1 - Right corner. * - TOP - 8 - Top corner. * - MIDDLE - 16 - Center between top and bottom corner. * - BOTTOM - 32 - Bottom corner. .. us.comment **Comment** Calls the :ref:`OBJSetUsePosWC` function. .. us.example **Example** :: // Creates a text object with the text ssText at the position // rvPosWC = [x,y] in diagram coordinates. The text object is // added to the diagram hLayer. // Example: TBCreateLabel(43, [0.002, 80], "Hello") // Example: TBCreateLabel(43, [0.002, 80], "Hello\nLine 2", LEFT|TOP) def TBCreateLabel(hLayer, rvPosWC, ssText, _nRefPoint) { nRefPoint = CENTER | BOTTOM; if (nargsin() == 4) { nRefPoint = _nRefPoint; } htext = TBCreate(); TBSetText(htext, ssText); TBSetAutoSize(htext, TRUE); TBSetEdgeDistance(htext, 0.03); OBJSetBkMode(htext, TRUE); // OPAQUE OBJSetEdge(htext, FALSE); // Edge rsSize = TBGetTextExtend(htext); OBJSetPosSize(htext, [0, 0, rsSize]); OBJSetPosWC(htext, rvPosWC); OBJSetRefPointWC(htext, nRefPoint); LayerAddObjects(hLayer, htext); return htext; } .. seealso:: :ref:`overview-drawing-objects`, :ref:`OBJSetPosWC`, :ref:`OBJGetRefPointWC`, :ref:`TBCreate` :sub:`id-1119158`