Skip to content
On this page

Dimension annotation

A notation is a graphic element used in a drawing to provide information about size, position, orientation, etc. It is the main technical basis for graphic reading and production guidance. Annotations can be created for various types of objects in a variety of directions as required. mxcad provides the Alignment annotation class and the rotation annotation class, if you have other annotation needs such as: Plan approval mark, arrow mark, and cloud line marked reference mxdraw library provides the dimensioning methods.

Note common concepts:

NameDescriptionto add
Annotated textThe stringused to indicate the measured value the text may also contain prefixes, suffixes, and tolerances
dimension lineindicates the direction and range of the annotationfor Angle annotation, the dimension line is an arc
The arrowdisplayed at both ends of the size linecan be used to specify different sizes and shapes for the arrow or slash
The dimension boundaryextends from the component to the dimension line

Align annotated dimension classes

You can create alignment annotations by instantiating a McDbAlignedDimension() object. Setting the start point xLine1Point, end point xLine2Point, location point dimLinePoint, and text attachment mode of McDbAlignedDimension() instance object textAttachment, Tilt Angle oblique, and other Settings to draw alignment annotations.

In addition, alignment annotations can be drawn directly through the drawDimAligned() method provided by the mxcad instance object.

Click McDbAlignedDimension() to check the properties and methods in detail.

Click drawDimAligned() to check the properties and methods in detail.

ts
import { MxCpp, McGePoint3d, McCmColor, McDb, McDbAlignedDimension } from "mxcad"

const mxcad = MxCpp.getCurrentMxCAD()
const mDimension = new McDbAlignedDimension()
mDimension.xLine1Point = new McGePoint3d(-1800, 0)
mDimension.xLine2Point = new McGePoint3d(0, 0)
mDimension.dimLinePoint = new McGePoint3d(-500, -500)
mDimension.textAttachment = McDb.AttachmentPoint.kTopLeft
mDimension.trueColor = new McCmColor(200, 255, 0)
mDimension.oblique = 0
mxcad.drawEntity(mDimension)

mxcad.addDimStyle("MyDimStyle", "41,0.18,141,0.09,40,200", "77,1,271,3", "", "");
mxcad.drawDimStyle = "MyDimStyle"
mxcad.drawDimAligned(100,0, 2000, 0, 1200, 0);

Rotate the dimensioning class

We can create a spin annotation by instantiating a McDbRotatedDimension() object.

In addition, rotation annotations can be drawn directly using the drawDimRotated() method provided by the mxcad instance object.

tap McDbRotatedDimension(), drawDimRotated() to check the detailed description attributes and methods.

ts
import { MxCpp, McGePoint3d, McCmColor, McDb, McDbRotatedDimension } from "mxcad"

const mxcad = MxCpp.getCurrentMxCAD()
const rDimension = new McDbRotatedDimension()
rDimension.xLine1Point = new McGePoint3d(100, -137)
rDimension.xLine2Point = new McGePoint3d(161,30)
rDimension.dimLinePoint = new McGePoint3d(80, -60)
rDimension.textAttachment = McDb.AttachmentPoint.kTopLeft
rDimension.textRotation = 1.5
rDimension.trueColor = new McCmColor(200, 255, 0)
rDimension.oblique = 0
rDimension.rotation = 0
mxcad.drawEntity(rDimension)

mxcad.addDimStyle("MyDimStyle", "41,0.18,141,0.09,40,200", "77,1,271,3", "", "");
mxcad.drawDimStyle = "MyDimStyle"
mxcad.drawDimRotated(0, 7000, 600, 7000, 250, 7050, 0);

Angle annotation

We can draw Angle annotations directly through the drawDimAngular() method provided by the mxcad instance object.

Click drawDimAngular() to check the properties and methods in detail.

ts
import { MxCpp } from "mxcad"

let mxcad = MxCpp.getCurrentMxCAD();

mxcad.addDimStyle("MyDimStyle2", "41,0.18,141,0.09,40,200", "77,1,271,3", "", "");
mxcad.drawDimStyle = "MyDimStyle2"
mxcad.drawDimAngular(500, 5000, 0, 5500, 1000, 5500, 500, 5500);