API_​LabelType

Represents a textual or a symbol label.

    typedef struct {
        union {
             API_Elem_Head       head;
             API_TextType        text;
             API_ObjectType      symbol;
        } u;
        API_LblClassID       labelClass;
        Int32                filler_1;
        API_DirID            textWay;
        Int32                filler_2[5];
        bool                 filler_3[2];
        short                font;
        unsigned short       faceBits;
        bool                 flipEnabled;
        bool                 nonBreaking;
        double               textSize;
        bool                 filler_4;
        bool                 useBgFill;
        short                fillBgPen;
        Int32                effectsBits;
        short                pen;
        short                filler_5;
        API_AttributeIndex   ltypeInd;
        double               contourOffset;
        bool                 framed;
        bool                 hasLeaderLine;
        char                 filler_6[6];
        API_ArrowData        arrowData;
        API_LblAnchorID      anchorPoint;
        API_LeaderLineShapeID  leaderShape;
        double               squareRootAngle;
        Int32                filler_7[4];
        API_ElemTypeID       parentType;
        bool                 filler_8[4];
        API_Guid             parent;
        API_Coord            begC;
        API_Coord            midC;
        API_Coord            endC;
        bool                 createAtDefaultPosition;
        char                 filler_9[23];
    } API_LabelType;

 

Members

u::head
General element header.
u::text
Describes the details of the textual label. The typeID field of the head should be set to API_LabelID (!).
u::symbol
Describes the details of the symbol label. The typeID field of the head should be set to API_LabelID (!).
labelClass
Type (class) of the label (see API_LblClassID).
textWay
Direction of text for textual labels (see API_DirID and the picture under Remarks). For labels only APIDir_Parallel, APIDir_Horizontal, APIDir_Vertical, and APIDir_General can be used.
font
Font attribute index (for symbol labels only).
faceBits
Style (face) of text (for symbol labels only):

APIFace_Plain

Plain text

APIFace_Bold

Bold

APIFace_Italic

Italic

APIFace_Underline

Underline

APIFace_Outline

Outlined (Macintosh only)

APIFace_Shadow

Shadow (Macintosh only)

flipEnabled New in API 19
True, if the Label is set to be “Always Readable”.
nonBreaking New in API 19
True, if “Wrap Text” is turned off for this Label.
textSize
Size of the text in mm (for symbol labels only).
useBgFill New in API 16
Switches opaque background for symbol labels.
fillBgPen New in API 16
Defines the background pen for symbol labels; effective only if useBgFill is true.
effectsBits New in API 16
Text effects to be applied for symbol labels:
APIEffect_StrikeOut Strikethrough text
APIEffect_SuperScript Superscript
APIEffect_SubScript Subscript
APIEffect_Fractional Fractional text (not used)
APIEffect_Protected Protected text (autotext reference)  Featuring API 10
pen
Pen attribute index of the leader line.
ltypeInd
Line type attribute index of the leader line.
framed
Put a frame around the content? (For both Symbol and Text Labels.)
contourOffset New in API 19
The padding of the Label’s frame (i.e. the distance between the frame and the text).
hasLeaderLine New in API 19
Add a Leader Line (i.e. pointer line) to the Label? (For both Symbol and Text Labels.)
arrowData
The arrow type.
anchorPoint
Anchor point the label pointer line is connected to. See API_LblAnchorID.
leaderShape New in API 19
Leader line shape. For the list of available shapes see API_LeaderLineShapeID.
squareRootAngle New in API 19
Used only if leaderShape == API_SquareRoot. Valid range: 1° <= squareRootAngle <= 179°, in radians. For the meaning of the angle see the picture under Remarks.
parentType
The type of the parent element is returned in it, or API_ZombieElemID if the Label is independent. At Label creation it is ignored.
When getting the Label defaults the labelable element type can be given in it. ACAPI_Element_GetDefaults will return the Label default for the given element type.
parent Changed in API 12
When creating new Labels,
  • set this to APINULLGuid to create an independent Label; or
  • set this to the GUID of the owner element (a labelable element) to create an associative Label. For the list of labelable elements see ACAPI_Element_GetConnectedElements.
When getting or changing a Label, this member will be filled with the GUID of the owner element, or APINULLGuid, if the Label is independent. It is not allowed to make an existing associative Label independent, or make an existing independent Label associative.
begC
Beginning coordinate of the leader line.
midC
Middle coordinate of the leader line.
endC
End coordinate of the leader line.
createAtDefaultPosition New in API 19
When creating associative Labels,
  • if set to true, the Label will be created at its default position (begC, midC, endC is ignored);
  • if set to false, the Label will be created at begC, midC, endC.

 

Remarks

For label related memo data (e.g. content, additional parameters) see the ACAPI_Element_GetMemo function.

The interpretation of the textWay field is:

Label direction

The squareRootAngle is marked with ? on the following picture:

Square root angle

The titleTyp field has been removed in API 21.

 

Requirements

Version: API 2.1 or later
Header: APIdefs_Elements.h

 

See Also

API_AttributeIndex, API_Elem_Head, API_LblClassID, API_TextType, API_ObjectType,
API_DirID, API_ArrowData, API_ElemTypeID, API_Coord, API_Element,
API_ElementMemo,
Element Manager, API Types