Linear Dimension
Below we will consider the PMI object defining a distance between two points.
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 linear dimension object (TypeScript):
export type C3DViewLineDimension = {
type: C3DViewObjectTypes.LineDimension // "LineDimension"
uuid?: string
points: {
p1: C3DViewPoint
p2: C3DViewPoint
tp?: C3DViewPoint
}
placement: C3DViewPlacement
options: C3DViewDimensionOptions
userData: C3DUserData
}
type: The necessary field, its value can be
C3DViewObjectTypes.LineDimension
or a string"LineDimension"
.uuid: The unique identifier of the dimension used for selecting.
points: The group of points to build an object:
p1: The first point of an object on geometry.
p2: The second 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 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 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 the 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;