Skip to content

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

Class: McDbXlsxTable

2d.McDbXlsxTable

Custom entity.

Example

ts
import { IMcDbDwgFiler, McDbCustomEntity, McDbLine, McDbPolyline, McGePoint3d, McGePoint3dArray, MxCADUiPrPoint, MxCADWorldDraw, MxCpp } from "mxcad";
import { MxFun } from "mxdraw";

//Create a new McDbTestLineCustomizing Entity class to inherit McDbCustomizing Entity
   class McDbTestLineCustomEntity extends McDbCustomEntity {
//Define the point object pt1 inside McDbtTestLineCustomizing Entity pt2
   private pt1: McGePoint3d = new McGePoint3d();
   private pt2: McGePoint3d = new McGePoint3d();
//Constructor function
   constructor(imp?: any) {
       super(imp);
   }
//Create Function
   public create(imp: any) {
       return new McDbTestLineCustomEntity(imp)
   }
//Get class name
   public getTypeName(): string {
       return "McDbTestLineCustomEntity";
   }
//Read custom entity data pt1 pt2
   public dwgInFields(filter: IMcDbDwgFiler): boolean {
       this.pt1 = filter.readPoint("pt1").val;
       this.pt2 = filter.readPoint("pt2").val;
       return true;
   }
//Write custom entity data pt1 pt2
   public dwgOutFields(filter: IMcDbDwgFiler): boolean {
       filter.writePoint("pt1", this.pt1);
       filter.writePoint("pt2", this.pt2);
       return true;
   }
//Processing grip editing effects
   public moveGripPointsAt(iIndex: number, dXOffset: number, dYOffset: number, dZOffset: number) {
       this.assertWrite();
       if (iIndex == 0) {
       this.pt1.x += dXOffset;
       this.pt1.y += dYOffset;
       this.pt1.z += dZOffset;
       }
       else if (iIndex == 1) {
       this.pt2.x += dXOffset;
       this.pt2.y += dYOffset;
       this.pt2.z += dZOffset;
       }
   };
//Set object editing point
   public getGripPoints(): McGePoint3dArray {
       let ret = new McGePoint3dArray()
       ret.append(this.pt1);
       ret.append(this.pt2);
       return ret;
   };
//Draw entities
   public worldDraw(draw: MxCADWorldDraw): void {
       // let tmpline = new McDbLine(this.pt1, this.pt2);
       let pl= new McDbPolyline()
       pl.addVertexAt(this.pt1)
       pl.addVertexAt(this.pt2)
       pl.addVertexAt(new McGePoint3d())
       draw.drawEntity(pl);
   }
//Set PT1
   public setPoint1(pt1: McGePoint3d) {
       this.assertWrite();
       this.pt1 = pt1.clone();
   }
//Set PT2
   public setPoint2(pt2: McGePoint3d) {
       this.assertWrite();
       this.pt2 = pt2.clone();
   }
//Get pt1
   public getPoint1() {
       return this.pt1;
   }
//Obtain PT2
   public getPoint2() {
       return this.pt2;
   }
   }

Hierarchy

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new McDbXlsxTable(imp?)

Parameters

NameType
imp?any

Overrides

McDbCustomEntity.constructor

Properties

imp

imp: any = 0

Internal implementation object.

Inherited from

McDbCustomEntity.imp

Accessors

colWidth

get colWidth(): number

Table overall column width

Returns

number

set colWidth(val): void

Parameters

NameType
valnumber

Returns

void


colorIndex

get colorIndex(): number

Obtain object color index

Example

ts
 import { McDbEntity, ColorIndexType } from 'mxcad'
 const ent = new McDbEntity();
 ent.colorIndex = ColorIndexType.kByblock;
 console.log(ent.colorIndex)

Returns

number

Inherited from

McDbCustomEntity.colorIndex

set colorIndex(val): void

Set object color index

Parameters

NameTypeDescription
ValnumberColorIndexType

Returns

void

Inherited from

McDbCustomEntity.colorIndex


drawOrder

get drawOrder(): number

Display order of objects

Example

ts
//Assuming ent is a valid instance object
const order = ent.drawOrder();

Returns

number

Inherited from

McDbCustomEntity.drawOrder

set drawOrder(order): void

Display order of objects

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;
  }
})

Parameters

NameTypeDescription
Ordernumbersequential value

Returns

void

Inherited from

McDbCustomEntity.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

McDbCustomEntity.dxf0


layer

get layer(): string

Obtain the layer name of the object

Returns

string

Inherited from

McDbCustomEntity.layer

set layer(val): void

Set object layer name

Example

ts
 import { McDbEntity } from 'mxcad'
 const ent = new McDbEntity();
 ent.layer = "newLayerName";
 console.log(ent.layer)

Parameters

NameTypeDescription
ValstringLayer Name

Returns

void

Inherited from

McDbCustomEntity.layer


layerId

get layerId(): McObjectId

Get layer ID object

Example

ts
//Assuming ent is a valid instance object
const layerId = ent.layerId;

Returns

McObjectId

Inherited from

McDbCustomEntity.layerId

set layerId(id): void

Set Layer Id Object

Example

ts
//Assuming ent is a valid instance object
const mxcad = MxCpp.getCurrentMxCAD();
Const layerId=mxcad. addLayer (Test Layer)
ent.layerId = layerId;

Parameters

NameType
idMcObjectId

Returns

void

Inherited from

McDbCustomEntity.layerId


linetype

get linetype(): string

Obtain the object line type name

Returns

string

Inherited from

McDbCustomEntity.linetype

set linetype(val): void

Set object line type name

Example

ts
import { McDbEntity } from 'mxcad'
const ent = new McDbEntity()
ent.linetype = "MyLineType";
console.log(ent.linetype)

Parameters

NameTypeDescription
ValstringLine type name

Returns

void

Inherited from

McDbCustomEntity.linetype


linetypeId

get linetypeId(): McObjectId

Get entity object line type ID

Example

ts
//Assuming ent is a valid instance object
const linetypeId = ent.linetypeId;

Returns

McObjectId

Inherited from

McDbCustomEntity.linetypeId

set linetypeId(id): void

Set entity object line type ID

Example

ts
//Assuming ent is a valid instance object
const mxcad = MxCpp.getCurrentMxCAD();
const lineId = mxcad.addLinetypeEx("TestMyLine", '25,-5');
ent.linetypeId = lineId;

Parameters

NameType
idMcObjectId

Returns

void

Inherited from

McDbCustomEntity.linetypeId


linetypeScale

get linetypeScale(): number

Obtain the proportion of object line types

Returns

number

Inherited from

McDbCustomEntity.linetypeScale

set linetypeScale(val): void

Set object line type scale

Example

ts
import { McDbEntity } from 'mxcad'
const ent = new McDbEntity()
ent.linetypeScale = 0.8;
console.log(ent.linetypeScale)

Parameters

NameTypeDescription
ValnumberLine type ratio

Returns

void

Inherited from

McDbCustomEntity.linetypeScale


lineweight

get lineweight(): number

Obtain object line weight

Returns

number

Inherited from

McDbCustomEntity.lineweight

set lineweight(val): void

Set object line weight

Example

ts
import { McDbEntity } from 'mxcad'
const ent = new McDbEntity()
ent.lineweight = 20;
console.log(ent.lineweight)

Parameters

NameTypeDescription
Valnumberline weight

Returns

void

Inherited from

McDbCustomEntity.lineweight


normal

get normal(): McGeVector3d

Return the normal of the object

Example

ts

Returns

McGeVector3d

Inherited from

McDbCustomEntity.normal

set normal(val): void

Set the normal of the object

Example

ts

Parameters

NameType
valMcGeVector3d

Returns

void

Inherited from

McDbCustomEntity.normal


objectName

get objectName(): string

Get the object name.

Example

ts
import { McRxObject } from 'mxcad';

let obj = new McRxObject();
console.log(obj.objectName);

Returns

string

Return object name

Inherited from

McDbCustomEntity.objectName


position

get position(): McGePoint3d

Table Position and Size - Required for Rendering

Returns

McGePoint3d

set position(val): void

Parameters

NameType
valMcGePoint3d

Returns

void


rowHeight

get rowHeight(): number

Table overall row height

Returns

number

set rowHeight(val): void

Parameters

NameType
valnumber

Returns

void


styleName

get styleName(): string

Table Style Name

Returns

string

set styleName(val): void

Parameters

NameType
valstring

Returns

void


textStyle

get textStyle(): string

Obtain the text style of the object

Returns

string

Inherited from

McDbCustomEntity.textStyle

set textStyle(val): void

Set object text style

Example

ts
import { McDbEntity } from 'mxcad'
const ent = new McDbEntity()
ent.textStyle = "st_style";

Parameters

NameTypeDescription
ValstringText style name

Returns

void

Inherited from

McDbCustomEntity.textStyle


textStyleId

get textStyleId(): McObjectId

Get entity text style

Example

ts
//Assuming ent is a valid instance object
const textStyleId = ent.textStyleId;

Returns

McObjectId

Inherited from

McDbCustomEntity.textStyleId

set textStyleId(id): void

Set the text style of the entity

Example

ts
//Assuming ent is a valid instance object
const mxcad = MxCpp.getCurrentMxCAD();
const textStyleId = mxcad.addTextStyle("MyLineTypeTextStyle", "txt.shx", "hztxt.shx", 1);
ent.textStyleId = textStyleId;

Parameters

NameType
idMcObjectId

Returns

void

Inherited from

McDbCustomEntity.textStyleId


trueColor

get trueColor(): McCmColor

Obtain the color of the object

Example

ts
 import { McDbEntity, McCmColor} from 'mxcad'
 const ent = new McDbEntity();
 ent.trueColor = new McCmColor(255, 0, 0);
 console.log(ent.trueColor)

Returns

McCmColor

Inherited from

McDbCustomEntity.trueColor

set trueColor(val): void

Set object color

Parameters

NameType
valMcCmColor

Returns

void

Inherited from

McDbCustomEntity.trueColor


visible

get visible(): boolean

Is the object visible

Returns

boolean

Inherited from

McDbCustomEntity.visible

set visible(val): void

Set whether it is visible

Example

ts
import { McDbEntity } from 'mxcad'
const ent = new McDbEntity()
ent.visible = true;
console.log(ent.visible)

Parameters

NameTypeDescription
ValbooleanBoolean value

Returns

void

Inherited from

McDbCustomEntity.visible


xlsxData

get xlsxData(): string

Returns

string

set xlsxData(data): void

Parameters

NameType
datastring

Returns

void

Methods

IntersectWith

IntersectWith(intersectObject, exOption): McGePoint3dArray

Intersection with other entities to obtain the intersection point

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)

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

Inherited from

McDbCustomEntity.IntersectWith


addSelectedCell

addSelectedCell(row, col): void

Add a cell to the selected collection

Parameters

NameTypeDescription
Rownumberrow index (0-based)
Colnumbercolumn index (0-based)

Returns

void


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.

Example

ts
//Assuming obj is a database object
obj.assertObjectModification()

Parameters

NameTypeDefault value
autoUndobooleanfalse

Returns

number

Inherited from

McDbCustomEntity.assertObjectModification


calculateTableDimensions

calculateTableDimensions(): Object

Calculate table size

Returns

Object

NameType
heightnumber
widthnumber

clearSelectedCell

clearSelectedCell(): void

Clear the currently selected cell

Returns

void


clone

clone(): null | McDbObject

Copy entity

Example

ts
import { McDbCustomEntity } from "mxcad";

const customEnt = new McDbCustomEntity();//  Construct a new custom entity object
const cloneEnt = customEnt.clone();//  Copy entity

Returns

null | McDbObject

Inherited from

McDbCustomEntity.clone


create

create(imp): McDbXlsxTable

Create a new custom object (by default, call its constructor to create a new object)

Parameters

NameType
impany

Returns

McDbXlsxTable

Overrides

McDbCustomEntity.create


createExtensionDictionary

createExtensionDictionary(): boolean

Create extended dictionary data for objects

Example

ts
//Assuming obj is a database object
const res = obj.createExtensionDictionary();

Returns

boolean

Inherited from

McDbCustomEntity.createExtensionDictionary


deleteColumn

deleteColumn(onSelectionChange?): void

Delete the selected column

Parameters

NameTypeDescription
onSelectionChange? (cells: {col: number; row: number} [])=>voidOptional selection change callback

Returns

void


deleteRow

deleteRow(onSelectionChange?): void

Delete the selected row

Parameters

NameTypeDescription
onSelectionChange? (cells: {col: number; row: number} [])=>voidOptional selection change callback

Returns

void


deleteXData

deleteXData(appName): boolean

Delete data related to entity specified application name

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
}

Parameters

NameTypeDescription
AppNamestringExtended Data Name

Returns

boolean

Inherited from

McDbCustomEntity.deleteXData


disableDisplay

disableDisplay(isDisable): void

Disable automatic update display of objects

Example

ts
import { McDbLine } from 'mxcad'
const line1 = new McDbLine(new McGePoint3d(0,0,0), new McGePoint3d(20,1,0));
line1.disableDisplay(true)

Parameters

NameTypeDescription
IsDisablebooleanDo you want to disable automatic object update display

Returns

void

Inherited from

McDbCustomEntity.disableDisplay


dwgInFields

dwgInFields(filter): boolean

Read custom entity data fields from DWG files

Example

ts
 import { McDbCustomEntity, IMcDbDwgFiler } from 'mxcad'
//Create a new McDbTestLineCustomizing Entity class to inherit McDbCustomizing Entity
 class McDbTestLineCustomEntity extends McDbCustomEntity {
//Define the point object pt1 inside McDbtTestLineCustomizing Entity pt2
   private pt1: McGePoint3d = new McGePoint3d();
   private pt2: McGePoint3d = new McGePoint3d(); 
//Read the data field pt1 of the custom entity pt2
   public dwgInFields(filter: IMcDbDwgFiler): boolean {
   this.pt1 = filter.readPoint("pt1").val;
   this.pt2 = filter.readPoint("pt2").val;
   return true;
   }
 }

Parameters

NameType
filterIMcDbDwgFiler

Returns

boolean

Overrides

McDbCustomEntity.dwgInFields


dwgOutFields

dwgOutFields(filter): boolean

Write the data fields of custom entities to a DWG file

Example

ts
//Create a new McDbTestLineCustomizing Entity class to inherit McDbCustomizing Entity
 import { McDbCustomEntity, IMcDbDwgFiler } from 'mxcad'
 class McDbTestLineCustomEntity extends McDbCustomEntity {
//Define the point object pt1 inside McDbtTestLineCustomizing Entity pt2
   private pt1: McGePoint3d = new McGePoint3d();
   private pt2: McGePoint3d = new McGePoint3d();
//Write the data field pt1 to the custom entity pt2
   public dwgOutFields(filter: IMcDbDwgFiler): boolean {
       filter.writePoint("pt1", this.pt1);
       filter.writePoint("pt2", this.pt2);
       return true;
   }
   }

Parameters

NameType
filterIMcDbDwgFiler

Returns

boolean

Overrides

McDbCustomEntity.dwgOutFields


erase

erase(): boolean

Delete object.

Example

ts
//Assuming obj is a database object
const res = obj.erase();
console.log(res);

Returns

boolean

Whether the deletion was successful.

Inherited from

McDbCustomEntity.erase


explode

explode(): MxCADResbuf

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

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);
          }
      }

Returns

MxCADResbuf

Rebuf data

Inherited from

McDbCustomEntity.explode


getAllAppName

getAllAppName(): McGeStringArray

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

Example

ts
//Assuming ent is a valid instance object
const appNames = ent.getAllAppName();
console.log(appNames);

Returns

McGeStringArray

Inherited from

McDbCustomEntity.getAllAppName


getAllColumnWidths

getAllColumnWidths(): IColumnWidth[]

Get all column width settings

Returns

IColumnWidth[]


getAllRowHeights

getAllRowHeights(): IRowHeight[]

Get all row height settings

Returns

IRowHeight[]


getArea

getArea(): Object

Calculate Area

Example

ts
import { McGePoint3d, McDbCircle } from "mxcad"

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

Returns

Object

Is the val area value | ret successfully obtained

NameType
retboolean
valnumber

Inherited from

McDbCustomEntity.getArea


getBoundingBox

getBoundingBox(): Object

Obtain the minimum outsourcing of the object

Returns

Object

NameType
maxPtMcGePoint3d
minPtMcGePoint3d
retboolean

Inherited from

McDbCustomEntity.getBoundingBox


getCellAlignment

getCellAlignment(row, col): undefined | "center" | "left" | "right"

Get the horizontal alignment of cells

Parameters

NameTypeDescription
Rownumberrow index (0-based)
Colnumbercolumn index (0-based)

Returns

undefined | "center" | "left" | "right"

Horizontal alignment method, if not set, returns' left '


getCellAtPoint

getCellAtPoint(point): null | { col: number ; row: number }

Convert CAD coordinate points to cell positions in a table

Parameters

NameTypeDescription
Point[McGePoint3d] (2d. McGePoint3d. md)A 3D point in CAD space

Returns

null | { col: number ; row: number }

Cell position {row, col} or null (when the point is not within the table)


getCellBackgroundColor

getCellBackgroundColor(row, col): undefined | null | number

Get cell background color

Parameters

NameTypeDescription
Rownumberrow index (0-based)
Colnumbercolumn index (0-based)

Returns

undefined | null | number

Cell background color, return null if not set


getCellBorderLineType

getCellBorderLineType(row, col): undefined | string

Get cell border line type

Parameters

NameTypeDescription
Rownumberrow index (0-based)
Colnumbercolumn index (0-based)

Returns

undefined | string

Cell border line type, if not set, returns undefined


getCellBorderLineWeight

getCellBorderLineWeight(row, col): undefined | number

Get cell border line width

Parameters

NameTypeDescription
Rownumberrow index (0-based)
Colnumbercolumn index (0-based)

Returns

undefined | number

Cell border line width, if not set, returns undefined


getCellFromReference

getCellFromReference(cellRef): null | { col: number ; row: number }

Retrieve cell index from A1 format reference

Parameters

NameTypeDescription
CellRefstringA1 format cell reference (e.g. "A1", "B2")

Returns

null | { col: number ; row: number }

Cell index {row, col} or null (when reference is invalid)


getCellGeometry

getCellGeometry(row, col): null | { max: McGePoint3d ; min: McGePoint3d }

Get the geometric range of the specified cell

Parameters

NameTypeDescription
Rownumberrow index (0-based)
Colnumbercolumn index (0-based)

Returns

null | { max: McGePoint3d ; min: McGePoint3d }

The geometric range of the cell {min: McGePoint3d, max: McGePoint3d} or null (when the cell does not exist)


getCellReference

getCellReference(row, col): string

Retrieve the A1 format reference of the specified cell

Parameters

NameTypeDescription
Rownumberrow index (0-based)
Colnumbercolumn index (0-based)

Returns

string

A1 format cell reference (e.g. "A1", "B2")


getCellStyles

getCellStyles(): CellStyleInfo

Get the style of the cell

Returns

CellStyleInfo


getCellTextAngle

getCellTextAngle(row, col): undefined | number

Get cell text angle

Parameters

NameTypeDescription
Rownumberrow index (0-based)
Colnumbercolumn index (0-based)

Returns

undefined | number

Cell text angle, if not set, returns undefined


getCellTextColor

getCellTextColor(row, col): undefined | null | number

Get cell text color

Parameters

NameTypeDescription
Rownumberrow index (0-based)
Colnumbercolumn index (0-based)

Returns

undefined | null | number

Cell text color, return null if not set


getCellTextStyle

getCellTextStyle(row, col): undefined | string

Get cell text style

Parameters

NameTypeDescription
Rownumberrow index (0-based)
Colnumbercolumn index (0-based)

Returns

undefined | string

Cell text style, if not set, returns undefined


getCellTextValue

getCellTextValue(row, col): string

Retrieve the plain text value of the cell (extract text if in Slate format)

Parameters

NameTypeDescription
Rownumberrow index (0-based)
Colnumbercolumn index (0-based)

Returns

string

The plain text value of a cell


getCellValue

getCellValue(row, col): any

Get the value of the specified cell

Parameters

NameTypeDescription
Rownumberrow index (0-based)
Colnumbercolumn index (0-based)

Returns

any

cell value


getCellVerticalAlignment

getCellVerticalAlignment(row, col): undefined | "top" | "bottom" | "middle"

Get the vertical alignment of cells

Parameters

NameTypeDescription
Rownumberrow index (0-based)
Colnumbercolumn index (0-based)

Returns

undefined | "top" | "bottom" | "middle"

Vertical alignment method, if not set, returns' top '


getColumnWidth

getColumnWidth(col): number

Get the width of the specified column

Parameters

NameTypeDescription
Colnumbercolumn index (0-based)

Returns

number

Column width, if not set, returns to default column width


getDatabase

getDatabase(): McDbDatabase

Get the database where the object is located

Example

ts
//Assuming obj is a database object
const data = obj.getDatabase();

Returns

McDbDatabase

Return to database

Inherited from

McDbCustomEntity.getDatabase


getDatabaseIndexId

getDatabaseIndexId(): number

Get the index ID of the object

Example

ts
//Assuming obj is a database object
const id = obj.getDatabaseIndexId();

Returns

number

Inherited from

McDbCustomEntity.getDatabaseIndexId


getExtensionDictionary

getExtensionDictionary(): McDbDictionary

Obtain the extended dictionary data of the object

Example

ts
//Assuming obj is a database object
const id = obj.getOwnerID();

Returns

McDbDictionary

Expand dictionary data

Inherited from

McDbCustomEntity.getExtensionDictionary


getGripPoints

getGripPoints(): McGePoint3dArray

Get the grip of the custom object.

Returns

McGePoint3dArray

Pinch object array

Overrides

McDbCustomEntity.getGripPoints


getHandle

getHandle(): string

Obtain object handle

Example

ts
//Assuming obj is a database object
const handle = obj.getHandle();

Returns

string

Return object handle

Inherited from

McDbCustomEntity.getHandle


getImp

getImp(): any

Retrieve internal implementation objects.

Example

ts
import { McRxObject } from 'mxcad';

let obj = new McRxObject();
let imp = obj.getImp();

Returns

any

Internal implementation object.

Inherited from

McDbCustomEntity.getImp


getJson

getJson(): string

Retrieve a string in JSON format.

Example

ts
import { McRxObject } from 'mxcad';

let obj = new McRxObject();
const json = obj.getJson()

Returns

string

A string in JSON format.

Inherited from

McDbCustomEntity.getJson


getMergeCells

getMergeCells(): IMergeCellInfo[]

Get merged cell information

Returns

IMergeCellInfo[]


getName

getName(): string

Get custom object name

Returns

string

Inherited from

McDbCustomEntity.getName


getObjectID

getObjectID(): McObjectId

Get the object ID.

Example

ts
import { McDbObject } from "mxcad";
const id = obj.getObjectID();

Returns

McObjectId

Object ID.

Inherited from

McDbCustomEntity.getObjectID


getOwnerID

getOwnerID(): number

Obtain the ID of the object owner

Example

ts
//Assuming obj is a database object
const id = obj.getOwnerID();

Returns

number

Inherited from

McDbCustomEntity.getOwnerID


getRowHeight

getRowHeight(row): number

Get the height of the specified row

Parameters

NameTypeDescription
Rownumberrow index (0-based)

Returns

number

Row height, if not set, returns to default row height


getSelectCellBackgroundColor

getSelectCellBackgroundColor(): undefined | null | number

Get the background color of the selected cell

Returns

undefined | null | number


getSelectCellTextColor

getSelectCellTextColor(): undefined | null | number

Get the text color of the selected cell

Returns

undefined | null | number


getSelectedCell

getSelectedCell(): null | { col: number ; row: number }

Retrieve the currently selected cell

Returns

null | { col: number ; row: number }

The first selected cell, if not selected, returns null


getSelectedCellCount

getSelectedCellCount(): number

Get the number of selected cells

Returns

number

Number of selected cells


getSelectedCells

getSelectedCells(): { col: number ; row: number }[]

Retrieve all selected cells

Returns

{ col: number ; row: number }[]

All selected cell arrays


getSelectionRange

getSelectionRange(): null | { maxCol: number ; maxRow: number ; minCol: number ; minRow: number }

Get the range of selected cells

Returns

null | { maxCol: number ; maxRow: number ; minCol: number ; minRow: number }

Include the minimum and maximum row and column indexes of the selected range


getTypeName

getTypeName(): string

Get the type name of the custom entity.

Returns

string

Custom entity type name

Overrides

McDbCustomEntity.getTypeName


getxData

getxData(appName?): MxCADResbuf

Obtain the extended data of the object

Example

ts
//Assuming ent is a valid instance object
const xData = ent.getXData();

Parameters

NameTypeDefault valueDescription
AppNamestring""Extended Data Name

Returns

MxCADResbuf

Inherited from

McDbCustomEntity.getxData


getxDataDouble

getxDataDouble(appName): Object

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

Example

ts
//Assuming ent is a valid instance object
let data = ent.getxDataDouble("DataName");
if(data.ret){
  console.log(data.val)
}

Parameters

NameTypeDescription
AppNamestringExtended Data Name

Returns

Object

Double value

NameType
retboolean
valnumber

Inherited from

McDbCustomEntity.getxDataDouble


getxDataLong

getxDataLong(appName): Object

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

Example

ts
//Assuming ent is a valid instance object
let data = ent.getxDataLong("DataName");
if(data.ret){
  console.log(data.val)
}

Parameters

NameTypeDescription
AppNamestringExtended Data Name

Returns

Object

Long value

NameType
retboolean
valnumber

Inherited from

McDbCustomEntity.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

McDbCustomEntity.getxDataPoint


getxDataString

getxDataString(appName): Object

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

Example

ts
//Assuming ent is a valid instance object
let data = ent.getxDataString("DataName");
if(data.ret){
  console.log(data.val)
}

Parameters

NameTypeDescription
AppNamestringExtended Data Name

Returns

Object

Val XData information | whether ret returns success

NameType
retboolean
valstring

Inherited from

McDbCustomEntity.getxDataString


hasUnmergedCellsSelected

hasUnmergedCellsSelected(): boolean

Check if any unmerged cells have been selected

Returns

boolean


highlight

highlight(isHighlight): void

Set whether the object is highlighted

Example

ts
import { McDbEntity } from 'mxcad'
const ent = new McDbEntity()
ent.highlight(true);

Parameters

NameTypeDescription
IsHighlightbooleanIs it highlighted

Returns

void

Inherited from

McDbCustomEntity.highlight


initTempObject

initTempObject(imp): void

Initialize temporary objects.

Example

ts
import { McRxObject } from 'mxcad';

let obj = new McRxObject();
obj.initTempObject()

Parameters

NameTypeDescription
'imp''any'Internal implementation object

Returns

void

Inherited from

McDbCustomEntity.initTempObject


insertColumn

insertColumn(position, onSelectionChange?): void

Insert a column at the specified location

Parameters

NameTypeDescription
Position"left" \"right"
onSelectionChange? (cells: {col: number; row: number} [])=>voidOptional selection change callback

Returns

void


insertRow

insertRow(position, onSelectionChange?): void

Insert a row at the specified location

Parameters

NameTypeDescription
Position"above" \"below"
onSelectionChange? (cells: {col: number; row: number} [])=>voidOptional selection change callback

Returns

void


isCellSelected

isCellSelected(row, col): boolean

Check if the specified cell is selected

Parameters

NameTypeDescription
Rownumberrow index
Colnumbercolumn index

Returns

boolean

Was it selected


isErased

isErased(): boolean

Has the object been deleted

Example

ts
//Assuming obj is a database object
const res = obj.isErased();
console.log(res);

Returns

boolean

Inherited from

McDbCustomEntity.isErased


isHaveExtensionDictionary

isHaveExtensionDictionary(): boolean

Is there any extended dictionary data available

Example

ts
//Assuming obj is a database object
const res = obj.isHaveExtensionDictionary();

Returns

boolean

Inherited from

McDbCustomEntity.isHaveExtensionDictionary


isKindOf

isKindOf(sObjectName): boolean

Determine object type

Example

ts
import { McRxObject } from 'mxcad';

let obj = new McRxObject();
let isKind = obj.isKindOf('SomeObjectType');
console.log(isKind); //  Output: True or false

Parameters

NameTypeDescription
SOrtNamestringType Name

Returns

boolean

Return whether the object is of the target type

Inherited from

McDbCustomEntity.isKindOf


isMergedCellSelected

isMergedCellSelected(): boolean

Check if merged cells are selected

Returns

boolean


isNull

isNull(): any

Determine if it is an empty object

Example

ts
import { McRxObject } from 'mxcad';

let obj = new McRxObject();
console.log(obj.isNull()); //  Output: True or false

Returns

any

Inherited from

McDbCustomEntity.isNull


mergeCells

mergeCells(onSelectionChange?): void

Merge selected cells

Parameters

NameTypeDescription
onSelectionChange? (cells: {col: number; row: number} [])=>voidOptional selection change callback

Returns

void


mirror

mirror(point1, point2): boolean

Mirror oriented object

Example

ts
import { McDbEntity, McGePoint3d } from 'mxcad'
const ent = new McDbEntity()
ent.mirror(new McGePoint3d(0,0,0), new McGePoint3d(20,10,0))

Parameters

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

Returns

boolean

Inherited from

McDbCustomEntity.mirror


move

move(fromPoint, toPoint): boolean

move objects

Example

ts
import { McDbEntity, McGePoint3d } from 'mxcad'
const ent = new McDbEntity()
ent.move(new McGePoint3d(0,0,0), new McGePoint3d(20,0,0))

Parameters

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

Returns

boolean

Inherited from

McDbCustomEntity.move


moveGripPointsAt

moveGripPointsAt(iIndex, dXOffset, dYOffset, dZOffset): void

Move the grip of custom objects.

Example

ts
  import { McDbCustomEntity, MxCADWorldDraw, McDbLine } from 'mxcad';
//Create a new McDbTestLineCustomizing Entity class to inherit McDbCustomizing Entity
  class McDbTestLineCustomEntity extends McDbCustomEntity {
//Define the point object pt1 inside McDbtTestLineCustomizing Entity pt2
       private pt1: McGePoint3d = new McGePoint3d();
       private pt2: McGePoint3d = new McGePoint3d();
//Move the grip of custom objects.
       public moveGripPointsAt(iIndex: number, dXOffset: number, dYOffset: number, dZOffset: number) {
           this.assertWrite();
           if (iIndex == 0) {
           this.pt1.x += dXOffset;
           this.pt1.y += dYOffset;
           this.pt1.z += dZOffset;
           }
           else if (iIndex == 1) {
           this.pt2.x += dXOffset;
           this.pt2.y += dYOffset;
           this.pt2.z += dZOffset;
           }
       };
   }

Parameters

NameTypeDescription
IIndexNumberGrip Index
DXOffsetnumberX-axis offset
DYOffsetnumberY-axis offset
DZOffsetnumberZ-axis offset

Returns

void

Overrides

McDbCustomEntity.moveGripPointsAt


resetColumnWidth

resetColumnWidth(col): void

Reset the width of the specified column to the default value

Parameters

NameTypeDescription
Colnumbercolumn index (0-based)

Returns

void


resetRowHeight

resetRowHeight(row): void

Reset the height of the specified row to the default value

Parameters

NameTypeDescription
Rownumberrow index (0-based)

Returns

void


rotate

rotate(basePoint, dRotationAngle): boolean

Rotate object

Example

ts
import { McDbEntity, McGePoint3d } from 'mxcad'
const ent = new McDbEntity()
ent.rotate(new McGePoint3d(0,0,0), Math.PI)

Parameters

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

Returns

boolean

Inherited from

McDbCustomEntity.rotate


rxInit

rxInit(): void

Custom Entity Registration

Example

ts
import { MxFun } from 'mxdraw
//MxCAD created successfully
MxFun.on("mxcadApplicationCreatedMxCADObject", (param) => {
//McDbtTestLineCustomizing Entity Custom Entity
new McDbTestLineCustomEntity().rxInit();//  Custom Entity Registration
MxFun.addCommand("MxTest_DrawCustomEntity");//  Register drawing entity command
})

Returns

void

Inherited from

McDbCustomEntity.rxInit


scaleEntity

scaleEntity(basePoint, dScaleFactor): boolean

Scaling objects

Example

ts
import { McDbEntity, McGePoint3d } from 'mxcad'
const ent = new McDbEntity()
ent.scaleEntity(new McGePoint3d(0,0,0), 0.5)

Parameters

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

Returns

boolean

Inherited from

McDbCustomEntity.scaleEntity


setAlignment

setAlignment(alignment, onSelectionChange?): void

Set the horizontal alignment of the selected cells

Parameters

NameTypeDescription
Alignment"center" \"left" \
onSelectionChange? (cells: {col: number; row: number} [])=>voidOptional selection change callback

Returns

void


setBatchCellAlignment

setBatchCellAlignment(cells, alignment): void

Batch Set Cell Horizontal Alignment Method

Parameters

NameTypeDescription
Cells(string \{col: number; row: number}) []
Alignment"center" \"left" \

Returns

void


setBatchCellBackgroundColor

setBatchCellBackgroundColor(cells, color): void

Batch set cell background color

Parameters

NameTypeDescription
Cells(string \{col: number; row: number}) []
colorundefined \null \

Returns

void


setBatchCellBorderLineType

setBatchCellBorderLineType(cells, lineType): void

Batch set cell border line type

Parameters

NameTypeDescription
Cells(string \{col: number; row: number}) []
LineTypestringBorder line type (such as "Continuous", "Dashed", "Dotted", etc.)

Returns

void


setBatchCellBorderLineWeight

setBatchCellBorderLineWeight(cells, lineWeight): void

Batch set cell border line width

Parameters

NameTypeDescription
Cells(string \{col: number; row: number}) []
LineWeightNumberBorder Width (in millimeters)

Returns

void


setBatchCellTextAngle

setBatchCellTextAngle(cells, textAngle): void

Batch Set Cell Text Angle

Parameters

NameTypeDescription
Cells(string \{col: number; row: number}) []
TextAnglenumberText angle (0-360 degrees)

Returns

void


setBatchCellTextColor

setBatchCellTextColor(cells, color): void

Batch set cell text color

Parameters

NameTypeDescription
Cells(string \{col: number; row: number}) []
colorundefined \null \

Returns

void


setBatchCellTextStyle

setBatchCellTextStyle(cells, textStyle): void

Batch set cell text style

Parameters

NameTypeDescription
Cells(string \{col: number; row: number}) []
TextStylestringText Style Name

Returns

void


setBatchCellVerticalAlignment

setBatchCellVerticalAlignment(cells, verticalAlignment): void

Batch set vertical alignment of cells

Parameters

NameTypeDescription
Cells(string \{col: number; row: number}) []
Vertical Alignment"top" \"bottom" \

Returns

void


setCellAlignment

setCellAlignment(row, col, alignment): void

Set the horizontal alignment of cells

Parameters

NameTypeDescription
Rownumberrow index (0-based)
Colnumbercolumn index (0-based)
Alignment"center" \"left" \

Returns

void


setCellAlignmentByRef

setCellAlignmentByRef(cellRef, alignment): boolean

Set the horizontal alignment of cells through A1 reference format

Parameters

NameTypeDescription
CellRefstringA1 format cell reference (e.g. "A1", "B2")
Alignment"center" \"left" \

Returns

boolean

Is the setting successful


setCellBackgroundColor

setCellBackgroundColor(row, col, color): void

Set cell background color

Parameters

NameTypeDescription
Rownumberrow index (0-based)
Colnumbercolumn index (0-based)
colorundefined \null \

Returns

void


setCellBackgroundColorByRef

setCellBackgroundColorByRef(cellRef, color): boolean

Set cell background color through A1 reference format

Parameters

NameTypeDescription
CellRefstringA1 format cell reference (e.g. "A1", "B2")
colorundefined \null \

Returns

boolean

Is the setting successful


setCellBorderLineType

setCellBorderLineType(row, col, lineType): void

Set cell border line type

Parameters

NameTypeDescription
Rownumberrow index (0-based)
Colnumbercolumn index (0-based)
LineTypestringBorder line type (such as "Continuous", "Dashed", "Dotted", etc.)

Returns

void


setCellBorderLineTypeByRef

setCellBorderLineTypeByRef(cellRef, lineType): boolean

Set cell border line type through A1 reference format

Parameters

NameTypeDescription
CellRefstringA1 format cell reference (e.g. "A1", "B2")
LineTypestringBorder line type (such as "Continuous", "Dashed", "Dotted", etc.)

Returns

boolean

Is the setting successful


setCellBorderLineWeight

setCellBorderLineWeight(row, col, lineWeight): void

Set cell border line width

Parameters

NameTypeDescription
Rownumberrow index (0-based)
Colnumbercolumn index (0-based)
LineWeightNumberBorder Width (in millimeters)

Returns

void


setCellBorderLineWeightByRef

setCellBorderLineWeightByRef(cellRef, lineWeight): boolean

Set cell border line width through A1 reference format

Parameters

NameTypeDescription
CellRefstringA1 format cell reference (e.g. "A1", "B2")
LineWeightNumberBorder Width (in millimeters)

Returns

boolean

Is the setting successful


setCellTextAngle

setCellTextAngle(row, col, textAngle): void

Set cell text angle

Parameters

NameTypeDescription
Rownumberrow index (0-based)
Colnumbercolumn index (0-based)
TextAnglenumberText angle (0-360 degrees)

Returns

void


setCellTextAngleByRef

setCellTextAngleByRef(cellRef, textAngle): boolean

Set the cell text angle through A1 reference format

Parameters

NameTypeDescription
CellRefstringA1 format cell reference (e.g. "A1", "B2")
TextAnglenumberText angle (0-360 degrees)

Returns

boolean

Is the setting successful


setCellTextColor

setCellTextColor(row, col, color): void

Set cell text color

Parameters

NameTypeDescription
Rownumberrow index (0-based)
Colnumbercolumn index (0-based)
colorundefined \null \

Returns

void


setCellTextColorByRef

setCellTextColorByRef(cellRef, color): boolean

Set cell text color through A1 reference format

Parameters

NameTypeDescription
CellRefstringA1 format cell reference (e.g. "A1", "B2")
colorundefined \null \

Returns

boolean

Is the setting successful


setCellTextStyle

setCellTextStyle(row, col, textStyle): void

Set cell text style

Parameters

NameTypeDescription
Rownumberrow index (0-based)
Colnumbercolumn index (0-based)
TextStylestringText Style Name

Returns

void


setCellTextStyleByRef

setCellTextStyleByRef(cellRef, textStyle): boolean

Set cell text style through A1 reference format

Parameters

NameTypeDescription
CellRefstringA1 format cell reference (e.g. "A1", "B2")
TextStylestringText Style Name

Returns

boolean

Is the setting successful


setCellValue

setCellValue(row, col, value): void

Set the value of the specified cell

Parameters

NameTypeDescription
Rownumberrow index (0-based)
Colnumbercolumn index (0-based)
valueanyCell value (Slate format or plain text)

Returns

void


setCellVerticalAlignment

setCellVerticalAlignment(row, col, verticalAlignment): void

Set the vertical alignment of cells

Parameters

NameTypeDescription
Rownumberrow index (0-based)
Colnumbercolumn index (0-based)
Vertical Alignment"top" \"bottom" \

Returns

void


setCellVerticalAlignmentByRef

setCellVerticalAlignmentByRef(cellRef, verticalAlignment): boolean

Set the vertical alignment of cells through A1 reference format

Parameters

NameTypeDescription
CellRefstringA1 format cell reference (e.g. "A1", "B2")
Vertical Alignment"top" \"bottom" \

Returns

boolean

Is the setting successful


setColumnWidth

setColumnWidth(col, width): void

Set the width of the specified column

Parameters

NameTypeDescription
Colnumbercolumn index (0-based)
Widthnumbercolumn width (in units consistent with style.colWidth)

Returns

void


setFromArray

setFromArray(data): void

Parameters

NameType
dataany[][]

Returns

void


setFromJson

setFromJson(jsonArray): void

Parameters

NameType
jsonArrayany[]

Returns

void


setFromWorkbook

setFromWorkbook(processedData): void

Parameters

NameType
processedDataICellStyleInfo

Returns

void


setJson

setJson(str): boolean

Set a string in JSON format.

Example

ts
import { McRxObject } from 'mxcad';

let obj = new McRxObject();
const res = obj.setJson('{"key": "value"}');
console.log(res)

Parameters

NameTypeDescription
StrstringJSON formatted string

Returns

boolean

Is the setting successful.

Inherited from

McDbCustomEntity.setJson


setMergeCells

setMergeCells(mergeCells): void

Set merged cell information

Parameters

NameType
mergeCellsIMergeCellInfo[]

Returns

void


setRowHeight

setRowHeight(row, height): void

Set the height of the specified row

Parameters

NameTypeDescription
Rownumberrow index (0-based)
Heightnumberline height (unit consistent with style.rowHeight)

Returns

void


setSelectCellBackgroundColor

setSelectCellBackgroundColor(color, onSelectionChange?): void

Set the background color of the selected cell

Parameters

NameTypeDescription
Colorundefinednull
onSelectionChange? (cells: {col: number; row: number} [])=>voidOptional selection change callback

Returns

void


setSelectCellTextColor

setSelectCellTextColor(color, onSelectionChange?): void

Set the text color of the selected cell

Parameters

NameTypeDescription
Colorundefinednull
onSelectionChange? (cells: {col: number; row: number} [])=>voidOptional selection change callback

Returns

void


setSelectedCell

setSelectedCell(row, col): void

Set the currently selected cell

Parameters

NameTypeDescription
Rownumberrow index (0-based)
Colnumbercolumn index (0-based)

Returns

void


setSelectedCells

setSelectedCells(cells): void

Set multiple selected cells

Parameters

NameTypeDescription
Cells{col: number; row: number} []array of cell positions [{row, col},...]

Returns

void


setVerticalAlignment

setVerticalAlignment(alignment, onSelectionChange?): void

Set the vertical alignment of the selected cells

Parameters

NameTypeDescription
Alignment"top" \"bottom" \
onSelectionChange? (cells: {col: number; row: number} [])=>voidOptional selection change callback

Returns

void


setxData

setxData(xdata): boolean

Set extended data for objects

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"}]));

Parameters

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

Returns

boolean

Inherited from

McDbCustomEntity.setxData


setxDataDouble

setxDataDouble(appName, val): boolean

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

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
}

Parameters

NameTypeDescription
AppNamestringExtended Data Name
Valnumberdouble value

Returns

boolean

Boolean value

Inherited from

McDbCustomEntity.setxDataDouble


setxDataLong

setxDataLong(appName, val): boolean

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

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
}

Parameters

NameTypeDescription
AppNamestringExtended Data Name
Valnumberlong value

Returns

boolean

Long value

Inherited from

McDbCustomEntity.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

McDbCustomEntity.setxDataPoint


setxDataString

setxDataString(appName, val): boolean

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

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.setxDataString("DataName", "xxxxx");
if(res){
//Setting successful
}else{
//Setting failed
}

Parameters

NameTypeDescription
AppNamestringExtended Data Name
Valstringstring value

Returns

boolean

Is the setting successful

Inherited from

McDbCustomEntity.setxDataString


syncData

syncData(toCpp?): boolean

JS object data and McDbCCustoms Entity: Synchronization of m_mapData.

Parameters

NameTypeDefault value
toCppbooleantrue

Returns

boolean

Inherited from

McDbCustomEntity.syncData


transformBy

transformBy(_mat): boolean

Get custom object matrix coordinate transformation

Parameters

NameType
_matMcGeMatrix3d

Returns

boolean

Overrides

McDbCustomEntity.transformBy


unErase

unErase(): boolean

Anti delete object.

Example

ts
//Assuming obj is a database object
const res = obj.unErase();
console.log(res);

Returns

boolean

Inherited from

McDbCustomEntity.unErase


unMergeCells

unMergeCells(onSelectionChange?): void

Cancel merging of selected cells

Parameters

NameTypeDescription
onSelectionChange? (cells: {col: number; row: number} [])=>voidOptional selection change callback

Returns

void


updateDisplay

updateDisplay(): void

Display the updated display of the calling object

Example

ts
//Assuming ent is a valid instance object
ent.updateDisplay()

Returns

void

Inherited from

McDbCustomEntity.updateDisplay


worldDraw

worldDraw(draw): void

Draw custom entities

Example

ts
  import { McDbCustomEntity, MxCADWorldDraw, McDbLine } from 'mxcad'
//Create a new McDbTestLineCustomizing Entity class to inherit McDbCustomizing Entity
  class McDbTestLineCustomEntity extends McDbCustomEntity {
//Define the point object pt1 inside McDbtTestLineCustomizing Entity pt2
     private pt1: McGePoint3d = new McGePoint3d();
     private pt2: McGePoint3d = new McGePoint3d();
//Draw entities
     public worldDraw(draw: MxCADWorldDraw): void {
       let tmpline = new McDbLine(this.pt1, this.pt2);
       draw.drawEntity(tmpline);
     }
   }

Parameters

NameType
drawMxCADWorldDraw

Returns

void

Overrides

McDbCustomEntity.worldDraw