Comment

Below we will consider the PMI object containing leader arrow and line with a text on it.

Comment object

Object

Common type of the comment object (TypeScript):

export type C3DViewComment = {
    type: C3DViewObjectTypes.Comment // "Comment"
    uuid?: string
    targetUuid?: string
    points: {
        target: C3DViewPoint
        shelf: C3DViewPoint
    }
    options: C3DViewCommentOptions
    userData: C3DUserData
}

The properties type, uuid, and userData are described here. Additionally for this PMI object:

  • type can be C3DViewObjectTypes.Comment or a string "Comment";

  • userData object is created in the process when returned in the onCreate event callback.

  1. targetUuid is an unique identifier of a target object.

  2. points is a group of points to build an object:

    • target is a target point on geometry;

    • shelf is a point of leader line position.

  3. options is additional options.

Additional options

The same as for creating process.

Type of comment options (TypeScript):

export type C3DViewCommentOptions = {
    group?: number
    text:string,
    font?:{
        family?:string,
        size?:number,
    }
    colors?:{
        text?:C3DViewRGB
        textBkg?:C3DViewRGB
    }
    tipType?: C3DTipType
    textFrame?: C3DFrame[]
    textOrigin?: {
        vertical?: C3DVerticalPosition
        horizontal?: C3DHorizontalPosition
    }
}
  1. group field defines to which group a comment belongs.

  2. text is a text value of object.

  3. font is a group of values to set up a text font:

    • family is a font family;

    • size is a {r, g, b} value of text color (the default is black).

  4. colors is a group of values to set up colors of a graphics object:

    • text is a {r, g, b} value of text color (the default is black);

    • textBkg is a {r, g, b} value of text background color (if undefined, background is transparent);

    • lines is a {r, g, b} value of line color (the default is black).

  5. tipType is a leader tip type. Available values (the default is 'Arrow').

  6. textFrame is a list of available frames for a comment text (the default is ["All"]).

  7. textOrigin is a group of values to change an anchor point of leader line to text:

New in version 1.7.0: Removed the option underlineText. Added the tipType, textFrame and textOrigin options.

Text frame

export enum C3DFrame {
    Bottom = 'Bottom',
    Right = 'Right',
    Top = 'Top',
    Left = 'Left',
    All = 'All',
}

Text origin

export enum C3DHorizontalPosition {
    Left = 'Left',
    Right = 'Right',
    Center = 'Center',
    Auto = 'Auto',
}

export enum C3DVerticalPosition {
    Center = 'Center',
    Above = 'Above',
    Below = 'Below',
    Auto = 'Auto',
}

Tip type

export enum C3DTipType {
    None = 'None',
    Arrow = 'Arrow',
    Circle = 'Circle',
    Hatch = 'Hatch'
}