Skip to content
On this page

mxcad_2d API 文档 / 2d / McObjectId

Class: McObjectId

2d.McObjectId

McObjectId类表示一个模型对象的唯一标识符。

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new McObjectId(id?, type?)

创建一个McObjectId实例。

Parameters

NameTypeDefault valueDescription
idnumber0对象的唯一标识符。
typeMcObjectIdTypeMcObjectIdType.kInvalid对象的类型。

Properties

id

id: number

对象ID


type

type: McObjectIdType

对象类型

Methods

clone

clone(): null | McDbObject

克隆对象

Returns

null | McDbObject


erase

erase(isErase?): void

删除对象。

Parameters

NameTypeDefault valueDescription
isErasebooleantrue是否删除

Returns

void


getMcDbBlockTableRecord

getMcDbBlockTableRecord(): null | McDbBlockTableRecord

返回MxCAD McDbBlockTableRecord 对象。

Returns

null | McDbBlockTableRecord


getMcDbCurve

getMcDbCurve(): null | McDbCurve

返回MxCAD McDbCurve 对象。

Returns

null | McDbCurve


getMcDbCustomEntity

getMcDbCustomEntity(): null | McDbCustomEntity

获取自定义实体

Returns

null | McDbCustomEntity


getMcDbDictionary

getMcDbDictionary(): null | McDbDictionary

获取数据库中的字典信息

Returns

null | McDbDictionary


getMcDbDimension

getMcDbDimension(): null | McDbDimension

返回MxCAD McDbDimension 对象。

Returns

null | McDbDimension


getMcDbEntity

getMcDbEntity(): null | McDbEntity

返回MxCAD McDbEntity 对象。

Returns

null | McDbEntity


getMcDbLayerTableRecord

getMcDbLayerTableRecord(): null | McDbLayerTableRecord

返回MxCAD McDbLayerTableRecord 对象。

Returns

null | McDbLayerTableRecord


getMcDbLinetypeTableRecord

getMcDbLinetypeTableRecord(): null | McDbLinetypeTableRecord

返回MxCAD McDbLinetypeTableRecord 对象。

Returns

null | McDbLinetypeTableRecord


getMcDbObject

getMcDbObject(): null | McDbObject

返回MxCAD McDbObject对象。

Returns

null | McDbObject


getMcDbRasterImageDef

getMcDbRasterImageDef(): null | McDbRasterImageDef

获取栅格图像信息

Returns

null | McDbRasterImageDef


getMcDbTextStyleTableRecord

getMcDbTextStyleTableRecord(): null | McDbTextStyleTableRecord

返回MxCAD McDbTextStyleTableRecord 对象。

Returns

null | McDbTextStyleTableRecord


getMcDbXrecord

getMcDbXrecord(): null | McDbXrecord

获取扩展记录信息

Returns

null | McDbXrecord


getMxDbEntity

getMxDbEntity(): null | MxDbEntity

返回MxDraw对象。

Returns

null | MxDbEntity


getObjectName

getObjectName(): string

返回id指向的对象名称.

Returns

string


isErase

isErase(): boolean

id是指向的以像,是否是删除状态.

Returns

boolean


isKindOf

isKindOf(className): boolean

判断一个对象的类型

Example

ts
import { McDbLine, McGePoint3d, MxCpp } from 'mxcad';

const line = new McDbLine(new McGePoint3d(0,0,0),new McGePoint3d(20,20,0) );
const objectId = MxCpp.getCurrentCAD().drawEntity(line);
console.log(objectId.isKindOf('McDbLine'))

Parameters

NameTypeDescription
classNamestring类型名

Returns

boolean


isNull

isNull(): boolean

id是否为NULL.

Returns

boolean


isValid

isValid(): boolean

id是否有效.

Returns

boolean


syncMcDbCustomEntity

syncMcDbCustomEntity(): void

同步自定义实体

Returns

void