Angle Dimension
Below we will consider the PMI object defining an angle between two vectors.
Object
You can get any dimension 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 angle dimension object (TypeScript):
export type C3DViewAngleDimension = {
type: C3DViewObjectTypes.AngleDimension // "AngleDimension"
uuid?: string
points: {
p1: C3DViewPoint
p2: C3DViewPoint
p3: C3DViewPoint
tp?: C3DViewPoint
}
placement: C3DViewPlacement
options: C3DViewDimensionOptions
userData: C3DUserData
}
type: The necessary field, its value can be
C3DViewObjectTypes.AngleDimension
or a string"AngleDimension"
.uuid: The unique identifier of the dimension used for selecting.
points The group of points to build an object:
p1: The starting point of an object on geometry.
p2: The center point of an object on geometry.
p3: The ending point of an object on geometry.
tp: The position of a dimension text.
placement: The plane to orientate geometry.
options: Additional options.
userData: Custom user data for 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 and linear dimension.
Type of dimension options (TypeScript):
export type C3DViewDimensionOptions = {
text?: string
underlineText?: boolean
font?: {
family?: string,
size?: number,
}
colors?: {
text?: C3DViewRGB
textBkg?: C3DViewRGB
lines?: 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
).lines: The
{r,g,b}
values of line colors (the default isblack
).
User Data
A custom user object that can be created by returning the process in the onCreate
event callback.
export type C3DUserData = object|undefined;