Skip to content

[mxcad_2d API documentation] (../README. md)/[2d] (../modules/2d. md)/McDbDiametricDimension

Class: McDbDiametricDimension ​

2d.McDbDiametricDimension

Represents a diameter annotation entity used to annotate the diameter of arcs or circles.

Description

McDbDiametricDimension provides diameter dimension annotation capability, defining diameter endpoints through chordPoint and farChordPoint, and supporting lead length and angle parameters. It can generate diameter dimensions that cross the center of the circle, suitable for diameter dimensions of circles, arcs, and other circular curves. Instructions:

  1. Create an instance of McDbDiametricDimension and set chordPoint, farChordPoint, and leaderLength.
  2. Call compute() to pass in the target entity and pick point.
  3. Add the annotated object to the current drawing context for display.

Example

ts
//Draw diameter annotation dimensions
import { MxCpp, MxCADResbuf, DxfCode, MxCADUiPrEntity, McDbRadialDimension, MxCADUiPrPoint } from "mxcad";

   async function _DrawDiametricDimension() {
       const mxcad = MxCpp.getCurrentMxCAD()
       const getEnt = new MxCADUiPrEntity();
       getEnt.setFilter(new MxCADResbuf([DxfCode.kEntityType, "ARC,CIRCLE"]));
GetEnt. setMessage ("Select Arc or Circle")
       const entId = await getEnt.go()
       if (entId.isNull()) return;
       const ent = entId.getMcDbEntity();
       if(!ent) return;

       let pick_pt = getEnt.pickPoint();

       let dim = new McDbDiametricDimension();
       dim.dimensionStyle = mxcad.database.getCurrentlyDimStyleId();
       dim.compute(ent,pick_pt);

       let getPoint = new MxCADUiPrPoint();
       getPoint.setUserDraw((currentPoint,pWorldDraw)=>{
           dim.compute(ent,currentPoint);
           pWorldDraw.drawMcDbEntity(dim,true);
       });
       if(!await getPoint.go() ) return;
       mxcad.drawEntity(dim);
   }

Hierarchy ​

Table of contents ​

Constructors ​

Properties ​

Accessors ​

Methods ​

Constructors ​

constructor ​

• new McDbDiametricDimension(imp?)

Constructor function

Parameters ​

NameTypeDescription
imp?AnyInternal implementation object

Overrides ​

McDbDimension.constructor

Properties ​

imp ​

• imp: any = 0

Internal implementation object.

Inherited from ​

McDbDimension.imp

Accessors ​

chordPoint ​

• get chordPoint(): McGePoint3d

Return to the first point on the annotated curve

Returns ​

McGePoint3d

• set chordPoint(pt): void

Parameters ​

NameType
ptMcGePoint3d

Returns ​

void


colorIndex ​

• get colorIndex(): number

Obtain object color index

Returns ​

number

Inherited from ​

McDbDimension.colorIndex

• set colorIndex(val): void

Set object color index

Parameters ​

NameTypeDescription
ValnumberColorIndexType

Returns ​

void

Inherited from ​

McDbDimension.colorIndex


dimensionStyle ​

• get dimensionStyle(): McObjectId

Set annotation style ID

Returns ​

McObjectId

Inherited from ​

McDbDimension.dimensionStyle

• set dimensionStyle(val): void

Parameters ​

NameType
valMcObjectId

Returns ​

void

Inherited from ​

McDbDimension.dimensionStyle


dimensionText ​

• get dimensionText(): string

Get or set annotation text

Returns ​

string

Inherited from ​

McDbDimension.dimensionText

• set dimensionText(val): void

Parameters ​

NameType
valstring

Returns ​

void

Inherited from ​

McDbDimension.dimensionText


drawOrder ​

• get drawOrder(): number

Display order of objects

Returns ​

number

Inherited from ​

McDbDimension.drawOrder

• set drawOrder(order): void

Display order of objects

Parameters ​

NameTypeDescription
Ordernumbersequential value

Returns ​

void

Example

ts
import { MxCpp, MxCADSelectionSet } from "mxcad";

let ss = new MxCADSelectionSet();
If (! Await ss.userSelect) return;
//Obtain the maximum and minimum display order of objects on the current graph
let minmaxOrder = MxCpp.getCurrentDatabase().currentSpace.getMinMaxDrawOrder();
//Place the object at the top.
let lOrder = minmaxOrder.maxDrawOrder + 1;
ss.forEach((id) => {
  let ent = id.getMcDbEntity();
  if (ent) {
    ent.drawOrder = lOrder;
  }
})

Inherited from ​

McDbDimension.drawOrder


dxf0 ​

• get dxf0(): string

Obtain the type name of the object's DXF group code, which is the same as the DXF group code in AutoCAD. For example, the type name of the line is McDbLine, and the group code value for DXF0 is: LINE and DXF0 group code values can be used for type filtering when constructing sets.

Returns ​

string

Inherited from ​

McDbDimension.dxf0


elevation ​

• get elevation(): number

Get or set height

Returns ​

number

Inherited from ​

McDbDimension.elevation

• set elevation(val): void

Parameters ​

NameType
valnumber

Returns ​

void

Inherited from ​

McDbDimension.elevation


extArcEndAngle ​

• get extArcEndAngle(): number

Annotate the end angle of the arc

Returns ​

number

• set extArcEndAngle(val): void

Annotate the end angle of the arc

Parameters ​

NameType
valnumber

Returns ​

void


extArcStartAngle ​

• get extArcStartAngle(): number

Annotate the starting angle of the arc

Returns ​

number

• set extArcStartAngle(val): void

Annotate the starting angle of the arc

Parameters ​

NameType
valnumber

Returns ​

void


farChordPoint ​

• get farChordPoint(): McGePoint3d

Return the second point on the annotated curve, which is opposite to the chordPoint diameter

Returns ​

McGePoint3d

• set farChordPoint(pt): void

Parameters ​

NameType
ptMcGePoint3d

Returns ​

void


horizontalRotation ​

• get horizontalRotation(): number

Get or set the horizontal rotation angle

Returns ​

number

Horizontal rotation angle

Inherited from ​

McDbDimension.horizontalRotation

• set horizontalRotation(val): void

Parameters ​

NameType
valnumber

Returns ​

void

Inherited from ​

McDbDimension.horizontalRotation


layer ​

• get layer(): string

Obtain the layer name of the object

Returns ​

string

Inherited from ​

McDbDimension.layer

• set layer(val): void

Set object layer name

Parameters ​

NameTypeDescription
ValstringLayer Name

Returns ​

void

Inherited from ​

McDbDimension.layer


layerId ​

• get layerId(): McObjectId

Get layer ID object

Returns ​

McObjectId

Inherited from ​

McDbDimension.layerId

• set layerId(id): void

Set Layer Id Object

Parameters ​

NameType
idMcObjectId

Returns ​

void

Inherited from ​

McDbDimension.layerId


leaderLength ​

• get leaderLength(): number

Label lead length

Returns ​

number

Label lead length

• set leaderLength(val): void

Set annotation leader length

Parameters ​

NameTypeDescription
ValnumberLabel leader length

Returns ​

void


linetype ​

• get linetype(): string

Obtain the object line type name

Returns ​

string

Inherited from ​

McDbDimension.linetype

• set linetype(val): void

Set object line type name

Parameters ​

NameTypeDescription
ValstringLine type name

Returns ​

void

Inherited from ​

McDbDimension.linetype


linetypeId ​

• get linetypeId(): McObjectId

Get entity object line type ID

Returns ​

McObjectId

Inherited from ​

McDbDimension.linetypeId

• set linetypeId(id): void

Set entity object line type ID

Parameters ​

NameType
idMcObjectId

Returns ​

void

Inherited from ​

McDbDimension.linetypeId


linetypeScale ​

• get linetypeScale(): number

Obtain the proportion of object line types

Returns ​

number

Inherited from ​

McDbDimension.linetypeScale

• set linetypeScale(val): void

Set object line type scale

Parameters ​

NameTypeDescription
ValnumberLine type ratio

Returns ​

void

Inherited from ​

McDbDimension.linetypeScale


lineweight ​

• get lineweight(): number

Obtain object line weight

Returns ​

number

Inherited from ​

McDbDimension.lineweight

• set lineweight(val): void

Set object line weight

Parameters ​

NameTypeDescription
Valnumberline weight

Returns ​

void

Inherited from ​

McDbDimension.lineweight


normal ​

• get normal(): McGeVector3d

Return the normal of the object

Returns ​

McGeVector3d

Inherited from ​

McDbDimension.normal

• set normal(val): void

Set the normal of the object

Parameters ​

NameType
valMcGeVector3d

Returns ​

void

Inherited from ​

McDbDimension.normal


objectName ​

• get objectName(): string

Get the object name.

Returns ​

string

Return object name

Inherited from ​

McDbDimension.objectName


textAttachment ​

• get textAttachment(): AttachmentPoint

Get or set text attachment point

Returns ​

AttachmentPoint

Text attachment point

Inherited from ​

McDbDimension.textAttachment

• set textAttachment(val): void

Parameters ​

NameType
valAttachmentPoint

Returns ​

void

Inherited from ​

McDbDimension.textAttachment


textPosition ​

• get textPosition(): McGePoint3d

Get text location

Returns ​

McGePoint3d

Text location

Inherited from ​

McDbDimension.textPosition

• set textPosition(pt): void

Set text position

Parameters ​

NameTypeDescription
PtMcGePoint3d (2d. McGePoint3d. md)Text Position

Returns ​

void

Inherited from ​

McDbDimension.textPosition


textRotation ​

• get textRotation(): number

Get or set text rotation angle

Returns ​

number

Inherited from ​

McDbDimension.textRotation

• set textRotation(val): void

Parameters ​

NameType
valnumber

Returns ​

void

Inherited from ​

McDbDimension.textRotation


textStyle ​

• get textStyle(): string

Obtain the text style of the object

Returns ​

string

Inherited from ​

McDbDimension.textStyle

• set textStyle(val): void

Set object text style

Parameters ​

NameTypeDescription
ValstringText style name

Returns ​

void

Inherited from ​

McDbDimension.textStyle


textStyleId ​

• get textStyleId(): McObjectId

Get entity text style

Returns ​

McObjectId

Inherited from ​

McDbDimension.textStyleId

• set textStyleId(id): void

Set the text style of the entity

Parameters ​

NameType
idMcObjectId

Returns ​

void

Example

ts
import { MxCADUiPrEntity, McDbEntity } from "mxcad";

let selEntity = new MxCADUiPrEntity();
SelEntity. setMessage ("Select Object");
let id = await selEntity.go();
if (!id.isValid()) return;
let ent:McDbEntity = id.getMcDbEntity();
if (ent === null) return;
const mxcad = MxCpp.getCurrentMxCAD();
const textStyleId = mxcad.addTextStyle("MyLineTypeTextStyle", "txt.shx", "hztxt.shx", 1);
ent.textStyleId = textStyleId;

Inherited from ​

McDbDimension.textStyleId


thickness ​

• get thickness(): number

Obtain the thickness of the object

Returns ​

number

Inherited from ​

McDbDimension.thickness

• set thickness(val): void

Set object thickness

Parameters ​

NameType
valnumber

Returns ​

void

Inherited from ​

McDbDimension.thickness


trueColor ​

• get trueColor(): McCmColor

Obtain the color of the object

Returns ​

McCmColor

Inherited from ​

McDbDimension.trueColor

• set trueColor(val): void

Set object color

Parameters ​

NameType
valMcCmColor

Returns ​

void

Inherited from ​

McDbDimension.trueColor


visible ​

• get visible(): boolean

Is the object visible

Returns ​

boolean

Inherited from ​

McDbDimension.visible

• set visible(val): void

Set whether it is visible

Parameters ​

NameTypeDescription
ValbooleanBoolean value

Returns ​

void

Inherited from ​

McDbDimension.visible

Methods ​

GetAllText ​

▸ GetAllText(): McGeStringArray

Obtain all textual content in the annotated object

Returns ​

McGeStringArray

McGeSringArray string array

Inherited from ​

McDbDimension.GetAllText


IntersectWith ​

▸ IntersectWith(intersectObject, exOption): McGePoint3dArray

Intersection with other entities to obtain the intersection point

Parameters ​

NameTypeDescription
IntersectObject[McDbEntity] (2d. McDbEntity. md)The entity object that needs to intersect is the entity object
ExOptionIntersection (../enums/2d. McDb. Intersect. md)Intersection options

Returns ​

McGePoint3dArray

Obtain all intersection points

Example

ts
import { McDbLine, McDb } from 'mxcad'
const line1 = new McDbLine(new McGePoint3d(0,0,0), new McGePoint3d(20,1,0));
const line2 = new McDbLine(new McGePoint3d(10,10,0), new McGePoint3d(11,1,0));
const ptArr = line1.IntersectWith(line2, McDb.Intersect.kExtendBoth)

Inherited from ​

McDbDimension.IntersectWith


assertObjectModification ​

▸ assertObjectModification(autoUndo?): number

Setting the state of the object to be changed can automatically trigger the update display function to update the display. For example, if the block table record is updated and the block reference needs to be notified to update the display, this function can be called.

Parameters ​

NameTypeDefault valueDescription
AutoUndobooleanfalseShould this modification automatically support undo? Default is false

Returns ​

number

Inherited from ​

McDbDimension.assertObjectModification


clone ​

▸ clone(): null | McDbObject

Clone objects.

Returns ​

null | McDbObject

The cloned object.

Inherited from ​

McDbDimension.clone


compute ​

▸ compute(ent, pickPoint): boolean

Calculate annotation parameters based on the annotated object and annotation points.

Parameters ​

NameType
entMcDbEntity
pickPointMcGePoint3d

Returns ​

boolean


createExtensionDictionary ​

▸ createExtensionDictionary(): boolean

Create extended dictionary data for objects

Returns ​

boolean

Inherited from ​

McDbDimension.createExtensionDictionary


deleteXData ​

▸ deleteXData(appName): boolean

Delete data related to entity specified application name

Parameters ​

NameTypeDescription
AppNamestringExtended Data Name

Returns ​

boolean

Example

ts
import { MxCADUiPrEntity, McDbEntity } from "mxcad";

let selEntity = new MxCADUiPrEntity();
SelEntity. setMessage ("Select Object");
let id = await selEntity.go();
if (!id.isValid()) return;
let ent:McDbEntity = id.getMcDbEntity();
if (ent === null) return;
const res = ent.deleteXData("DataName");
if(res){
//Delete successfully
}else
//Delete failed
}

Inherited from ​

McDbDimension.deleteXData


disableDisplay ​

▸ disableDisplay(isDisable): void

Disable automatic update display of objects

Parameters ​

NameTypeDescription
IsDisablebooleanDo you want to disable automatic object update display

Returns ​

void

Inherited from ​

McDbDimension.disableDisplay


erase ​

▸ erase(): boolean

Delete object.

Returns ​

boolean

Whether the deletion was successful.

Inherited from ​

McDbDimension.erase


explode ​

▸ explode(): MxCADResbuf

Break the object and return the linked list of the object's data after being broken

Returns ​

MxCADResbuf

Rebuf data

Example

ts
import { McDbEntity, MxCADResbuf } from "mxcad";
//Obtain the target object
let getEnt = new MxCADUiPrEntity();
GetEnt.setMessage ("Select object to break: ");
let id = await getEnt.go();
let ent:McDbEntity = id.getMcDbEntity();
if (ent === null) return;
//Smash objects
      let retExplode: MxCADResbuf = ent.explode();
      if (retExplode.GetCount() == 0) return;
      let iExplodeConut = retExplode.GetCount();
      for (let j = 0; j < iExplodeConut; j++) {
          let tmpobj = retExplode.AtObject(j).val;
          if(tmpobj instanceof McDbEntity ){
              mxcad.drawEntity(tmpobj);
          }
      }

Inherited from ​

McDbDimension.explode


getAllAppName ​

▸ getAllAppName(): McGeStringArray

Get the application name (AppName) of all XData records contained in the entity

Returns ​

McGeStringArray

Inherited from ​

McDbDimension.getAllAppName


getArea ​

▸ getArea(): Object

Calculate Area

Returns ​

Object

Is the val area value | ret successfully obtained

NameType
retboolean
valnumber

Example

ts
import { McGePoint3d, McDbCircle } from "mxcad"

const circle = new McDbCircle(0,0,0, 20);
const area = circle.getArea();
Console.log ("Circle area: ", area)

Inherited from ​

McDbDimension.getArea


getBoundingBox ​

▸ getBoundingBox(): Object

Obtain the minimum outsourcing of the object

Returns ​

Object

NameType
maxPtMcGePoint3d
minPtMcGePoint3d
retboolean

Inherited from ​

McDbDimension.getBoundingBox


getDatabase ​

▸ getDatabase(): McDbDatabase

Get the database where the object is located

Returns ​

McDbDatabase

Return to database

Inherited from ​

McDbDimension.getDatabase


getDatabaseIndexId ​

▸ getDatabaseIndexId(): number

Get the index ID of the object

Returns ​

number

Inherited from ​

McDbDimension.getDatabaseIndexId


getDimVarDouble ​

▸ getDimVarDouble(iType): number

Get floating-point values of annotated variables

Parameters ​

NameTypeDescription
ITypeNumberAnnotate variable types

Returns ​

number

Annotate variable floating-point values

Inherited from ​

McDbDimension.getDimVarDouble


getDimVarInt ​

▸ getDimVarInt(iType): number

Obtain integer values of annotated variables

Parameters ​

NameTypeDescription
ITypeNumberAnnotate variable types

Returns ​

number

Annotate the integer value of the variable

Inherited from ​

McDbDimension.getDimVarInt


getDimVarObjectId ​

▸ getDimVarObjectId(iType): McObjectId

Obtain the ID of the annotated variable object

Parameters ​

NameTypeDescription
ITypeNumberAnnotate variable types

Returns ​

McObjectId

Annotate variable object ID

Inherited from ​

McDbDimension.getDimVarObjectId


getDimVarString ​

▸ getDimVarString(iType): string

Get the string value of the annotation variable

Parameters ​

NameTypeDescription
ITypeNumberAnnotate variable types

Returns ​

string

Annotate variable string values

Inherited from ​

McDbDimension.getDimVarString


getExtensionDictionary ​

▸ getExtensionDictionary(): McDbDictionary

Obtain the extended dictionary data of the object

Returns ​

McDbDictionary

Expand dictionary data

Inherited from ​

McDbDimension.getExtensionDictionary


getGripEditBasePointsIndex ​

▸ getGripEditBasePointsIndex(): number[]

Retrieve the edit base point index corresponding to the grip of the object.

Returns ​

number[]

Inherited from ​

McDbDimension.getGripEditBasePointsIndex


getGripPoints ​

▸ getGripPoints(): McGePoint3dArray

Get the grip array of the object

Returns ​

McGePoint3dArray

Inherited from ​

McDbDimension.getGripPoints


getHandle ​

▸ getHandle(): string

Obtain object handle

Returns ​

string

Return object handle

Inherited from ​

McDbDimension.getHandle


getImp ​

▸ getImp(): any

Retrieve internal implementation objects.

Returns ​

any

Internal implementation object.

Inherited from ​

McDbDimension.getImp


getJson ​

▸ getJson(): string

Retrieve a string in JSON format.

Returns ​

string

A string in JSON format.

Inherited from ​

McDbDimension.getJson


getObjectID ​

▸ getObjectID(): McObjectId

Get the object ID.

Returns ​

McObjectId

Object ID.

Inherited from ​

McDbDimension.getObjectID


getOwnerID ​

▸ getOwnerID(): number

Obtain the ID of the object owner

Returns ​

number

Inherited from ​

McDbDimension.getOwnerID


getxData ​

▸ getxData(appName?): MxCADResbuf

Obtain the extended data of the object

Parameters ​

NameTypeDefault valueDescription
AppNamestring""Extended Data Name

Returns ​

MxCADResbuf

Inherited from ​

McDbDimension.getxData


getxDataDouble ​

▸ getxDataDouble(appName): Object

Retrieve the double value from the specified XData type of the entity

Parameters ​

NameTypeDescription
AppNamestringExtended Data Name

Returns ​

Object

Double value

NameType
retboolean
valnumber

Inherited from ​

McDbDimension.getxDataDouble


getxDataLong ​

▸ getxDataLong(appName): Object

Retrieve the long (integer) value from the specified XData type of the entity

Parameters ​

NameTypeDescription
AppNamestringExtended Data Name

Returns ​

Object

Long value

NameType
retboolean
valnumber

Inherited from ​

McDbDimension.getxDataLong


getxDataPoint ​

▸ getxDataPoint(appName): Object

Retrieve point objects from the specified XData type of entity

Parameters ​

NameTypeDescription
AppNamestringExtended Data Name

Returns ​

Object

Obtain results and 3D point objects

NameType
retboolean
valMcGePoint3d

Inherited from ​

McDbDimension.getxDataPoint


getxDataString ​

▸ getxDataString(appName): Object

Retrieve XData information associated with a specific entity and return it in string form

Parameters ​

NameTypeDescription
AppNamestringExtended Data Name

Returns ​

Object

Val XData information | whether ret returns success

NameType
retboolean
valstring

Inherited from ​

McDbDimension.getxDataString


highlight ​

▸ highlight(isHighlight): void

Set whether the object is highlighted

Parameters ​

NameTypeDescription
IsHighlightbooleanIs it highlighted

Returns ​

void

Inherited from ​

McDbDimension.highlight


initTempObject ​

▸ initTempObject(imp): void

Initialize temporary objects.

Parameters ​

NameTypeDescription
'imp''any'Internal implementation object

Returns ​

void

Inherited from ​

McDbDimension.initTempObject


isErased ​

▸ isErased(): boolean

Has the object been deleted

Returns ​

boolean

Inherited from ​

McDbDimension.isErased


isHaveExtensionDictionary ​

▸ isHaveExtensionDictionary(): boolean

Is there any extended dictionary data available

Returns ​

boolean

Inherited from ​

McDbDimension.isHaveExtensionDictionary


isKindOf ​

▸ isKindOf(sObjectName): boolean

Determine object type

Parameters ​

NameTypeDescription
SOrtNamestringType Name

Returns ​

boolean

Return whether the object is of the target type

Inherited from ​

McDbDimension.isKindOf


isNull ​

▸ isNull(): any

Determine if it is an empty object

Returns ​

any

Inherited from ​

McDbDimension.isNull


isUsingDefaultTextPosition ​

▸ isUsingDefaultTextPosition(): boolean

Do you want to use the default text position

Returns ​

boolean

Do you want to use the default text position

Inherited from ​

McDbDimension.isUsingDefaultTextPosition


mirror ​

▸ mirror(point1, point2): boolean

Mirror oriented object

Parameters ​

NameTypeDescription
Point1[McGePoint3d] (2d. McGePoint3d. md)Mirror Base Point
point2McGePoint3d-

Returns ​

boolean

Inherited from ​

McDbDimension.mirror


move ​

▸ move(fromPoint, toPoint): boolean

move objects

Parameters ​

NameTypeDescription
From Point[McGePoint3d] (2d. McGePoint3d. md)Move the starting point
ToPoint[McGePoint3d] (2d. McGePoint3d. md)Move End Point

Returns ​

boolean

Inherited from ​

McDbDimension.move


moveGripPointsAt ​

▸ moveGripPointsAt(iIndex, dXOffset, dYOffset, dZOffset): any

Grips for moving objects

Parameters ​

NameTypeDescription
IIndexNumberIndex
DXOffsetnumberX-axis offset
DYOffsetnumberY-axis offset
DZOffsetnumberZ-axis offset

Returns ​

any

Inherited from ​

McDbDimension.moveGripPointsAt


needToUpdateDimBlock ​

▸ needToUpdateDimBlock(need): void

Need to update annotation block

Parameters ​

NameType
needboolean

Returns ​

void

Inherited from ​

McDbDimension.needToUpdateDimBlock


recomputeDimBlock ​

▸ recomputeDimBlock(forceUpdate?, onlyCloneDimBlockRecord?): void

Recalculate annotation blocks

Parameters ​

NameTypeDefault value
forceUpdatebooleantrue
onlyCloneDimBlockRecordbooleanfalse

Returns ​

void

Inherited from ​

McDbDimension.recomputeDimBlock


rotate ​

▸ rotate(basePoint, dRotationAngle): boolean

Rotate object

Parameters ​

NameTypeDescription
BasePoint[McGePoint3d] (2d. McGePoint3d. md)Rotate the base point
DRotationAnglenumberRotation angle

Returns ​

boolean

Inherited from ​

McDbDimension.rotate


scaleEntity ​

▸ scaleEntity(basePoint, dScaleFactor): boolean

Scaling objects

Parameters ​

NameTypeDescription
BasePoint[McGePoint3d] (2d. McGePoint3d. md)Scale Base Point
DScaleFactornumberscaling factor (<1 zoom out;>1 zoom in)

Returns ​

boolean

Inherited from ​

McDbDimension.scaleEntity


setDimVarDouble ​

▸ setDimVarDouble(iType, val): void

Set floating-point values for annotation variables

Parameters ​

NameTypeDescription
ITypeNumberAnnotate variable types
ValnumberAnnotation variable floating-point value

Returns ​

void

Inherited from ​

McDbDimension.setDimVarDouble


setDimVarInt ​

▸ setDimVarInt(iType, val): void

Set integer values for annotation variables

Parameters ​

NameTypeDescription
ITypeNumberAnnotate variable types
ValnumberAnnotate the integer value of the variable

Returns ​

void

Inherited from ​

McDbDimension.setDimVarInt


setDimVarObjectId ​

▸ setDimVarObjectId(iType, val): void

Set annotation variable object ID

Parameters ​

NameTypeDescription
ITypeNumberAnnotate variable types
Val[McObjectid] (2d. McObjectid. md)Annotate variable object ID

Returns ​

void

Inherited from ​

McDbDimension.setDimVarObjectId


setDimVarString ​

▸ setDimVarString(iType, val): void

Set annotation variable string value

Parameters ​

NameTypeDescription
ITypeNumberAnnotate variable types
ValstringAnnotate variable string value

Returns ​

void

Inherited from ​

McDbDimension.setDimVarString


setJson ​

▸ setJson(str): boolean

Set a string in JSON format.

Parameters ​

NameTypeDescription
StrstringJSON formatted string

Returns ​

boolean

Is the setting successful.

Inherited from ​

McDbDimension.setJson


setxData ​

▸ setxData(xdata): boolean

Set extended data for objects

Parameters ​

NameTypeDescription
Xdata[MxCADResbuf] (2d. MxCADResbuf. md)Extended data linked list

Returns ​

boolean

Example

ts
import { MxCADUiPrEntity, McDbEntity } from "mxcad";

//Set extended data
let selEntity = new MxCADUiPrEntity();
SelEntity. setMessage ("Select Object");
let id = await selEntity.go();
if (!id.isValid()) return;
let ent:McDbEntity = id.getMcDbEntity();
if (ent === null) return;
ent.setxData(new MxCADResbuf([{type:DxfCode.kExDataName,val:"DataName"},{type:DxfCode.kString,val:"yyyyy"}]));

Inherited from ​

McDbDimension.setxData


setxDataDouble ​

▸ setxDataDouble(appName, val): boolean

Set the double value in the specified XData type of the entity

Parameters ​

NameTypeDescription
AppNamestringExtended Data Name
Valnumberdouble value

Returns ​

boolean

Boolean value

Example

ts
import { MxCADUiPrEntity, McDbEntity } from "mxcad";
let selEntity = new MxCADUiPrEntity();
SelEntity. setMessage ("Select Object");
let id = await selEntity.go();
if (!id.isValid()) return;
let ent:McDbEntity = id.getMcDbEntity();
if (ent === null) return;
const res = ent.setxDataDouble("DataName", 0);
if(res){
//Setting successful
}else{
//Setting failed
}

Inherited from ​

McDbDimension.setxDataDouble


setxDataLong ​

▸ setxDataLong(appName, val): boolean

Set the long (integer) value in the specified XData type of the entity

Parameters ​

NameTypeDescription
AppNamestringExtended Data Name
Valnumberlong value

Returns ​

boolean

Long value

Example

ts
import { MxCADUiPrEntity, McDbEntity } from "mxcad";

let selEntity = new MxCADUiPrEntity();
SelEntity. setMessage ("Select Object");
let id = await selEntity.go();
if (!id.isValid()) return;
let ent:McDbEntity = id.getMcDbEntity();
if (ent === null) return;
const res = ent.setxDataLong("DataName", 123456);
if(res){
//Setting successful
}else{
//Setting failed
}

Inherited from ​

McDbDimension.setxDataLong


setxDataPoint ​

▸ setxDataPoint(appName, val): boolean

Set the point object in the specified XData type of the entity

Parameters ​

NameTypeDescription
AppNamestringExtended Data Name
Val[McGePoint3d] (2d. McGePoint3d. md)Point Object

Returns ​

boolean

Obtain results and 3D point objects

Inherited from ​

McDbDimension.setxDataPoint


setxDataString ​

▸ setxDataString(appName, val): boolean

Set XData information associated with a specific entity and set it in string form

Parameters ​

NameTypeDescription
AppNamestringExtended Data Name
Valstringstring value

Returns ​

boolean

Is the setting successful

Inherited from ​

McDbDimension.setxDataString


syncData ​

▸ syncData(_toCpp?): boolean

Synchronize entity data. This method may be called after modifying the entity's attributes or attaching new data to ensure that all changes are correctly saved to the entity's database records.

Parameters ​

NameTypeDefault valueDescription
_toCppbooleantrueWhether to synchronize data

Returns ​

boolean

Inherited from ​

McDbDimension.syncData


transformBy ​

▸ transformBy(transformationMatrix): boolean

Transform object

Parameters ​

NameTypeDescription
TransformationMatrix[McGeMatrix3d] (2d. McGeMatrix3d. md)Transformation Matrix

Returns ​

boolean

Inherited from ​

McDbDimension.transformBy


unErase ​

▸ unErase(): boolean

Anti delete object.

Returns ​

boolean

Inherited from ​

McDbDimension.unErase


updateDisplay ​

▸ updateDisplay(): void

Display the updated display of the calling object

Returns ​

void

Inherited from ​

McDbDimension.updateDisplay


useDefaultTextPosition ​

▸ useDefaultTextPosition(): void

Use default text bits

Returns ​

void

Inherited from ​

McDbDimension.useDefaultTextPosition


useSetTextPosition ​

▸ useSetTextPosition(): void

Use the set text position

Returns ​

void

Inherited from ​

McDbDimension.useSetTextPosition