Comment
Below we will consider the PMI object containing leader arrow and line with a text on it.
Object
You can get any comment via a GetParameters command, as well as add and remove it via annotation commands. It uses the same type to represent a visual object everywhere.
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
}
type: The necessary field, its value can be
C3DViewObjectTypes.Comment
or a string"Comment"
.uuid: The unique identifier of the comment used for selecting.
targetUuid: The unique identifier of a target object.
points: The group of points to build an object:
target: The point of a target on geometry.
shelf: The point of a leader line position.
options: Additional options.
userData: Custom user data for an object.
Note
The new object will be created if the uuid
isn’t present.
The exist object with be update if the uuid
if the id belongs to it.
Additional options
The same as for creating process.
Type of comment options (TypeScript):
export type C3DViewCommentOptions = {
text: string,
underlineText?: boolean,
font?: {
family?: string,
size?: number,
}
colors?: {
text?: C3DViewRGB
textBkg?: C3DViewRGB
}
}
text: The text value of an object.
underlineText: The flag for underlined text.
font: The group of values to change a text font:
family: The font family.
size: The
{r,b,g}
values of text colors (the default isblack
).
colors: The group of values to change colors of a graphics object:
text: The
{r,b,g}
values of text colors (the default isblack
).textBks: The
{r,g,b}
values of background text colors. The background is transparent if you set the undefined value (the default istransparent
).
User Data
The custom user object that can be created by returning the process in the onCreate
event callback.
export type C3DUserData = object|undefined;