Skip to content

mxcad_2d API 文档 / 2d / McDbRasterImage

Class: McDbRasterImage

2d.McDbRasterImage

McDbRasterImage 是光栅图片实体类,用于在 CAD 中显示位图图像。

Description

该类用于插入和管理光栅图像对象,支持设置图像定义 ID、显示尺寸、方向和裁剪边界。

它适合在绘图中嵌入外部图片资源,并根据需要控制图像的位置、缩放和裁剪效果。

使用方法总结:

  1. 先创建 McDbRasterImage 实例。
  2. 再设置图像定义 ID、显示尺寸、方向和裁剪边界。
  3. 最后将其绘制到当前空间中。

Example

ts
import { MxCpp, McGePoint3d, McDbRasterImage, McGeVector3d } from "mxcad";

//画图片
function drawImg() {
    const mxcad = MxCpp.getCurrentMxCAD();
    mxcad.newFile();
    let imagUrl = "https://cdn.pixabay.com/photo/2022/11/15/12/23/winter-7593872_960_720.jpg";
    mxcad.loadImage(imagUrl, (image) => {
        if (!image) {
            console.log("loadImage failed");
            return;
        }
        let width = mxcad.mxdraw.viewCoordLong2Cad(100);
        let height = (image.height / image.width) * width;
        const id = mxcad.addImageDefine(imagUrl, "winter-7593872_960_720.jpg", true);
        const img = new McDbRasterImage();
        img.setImageDefId(id);
        img.setDwgImageSize(image.width, image.height);
        const origin = new McGePoint3d(0, 0, 0);
        const uCorner = McGeVector3d.kXAxis.clone();
        uCorner.mult(width);
        const vOnPlane = McGeVector3d.kYAxis.clone();
        vOnPlane.mult(height);
        img.setOrientation(origin, uCorner, vOnPlane);
        mxcad.drawEntity(img);
        mxcad.updateDisplay();
    });
};

Hierarchy

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new McDbRasterImage(x?)

构造函数。

Parameters

NameType
x?object

Overrides

McDbEntity.constructor

Properties

imp

imp: any = 0

内部实现对象。

Inherited from

McDbEntity.imp

Accessors

colorIndex

get colorIndex(): number

得到对象颜色索引

Returns

number

Inherited from

McDbEntity.colorIndex

set colorIndex(val): void

设置对象颜色索引

Parameters

NameTypeDescription
valnumber颜色索引(ColorIndexType)

Returns

void

Inherited from

McDbEntity.colorIndex


drawOrder

get drawOrder(): number

对象的显示顺序

Returns

number

Inherited from

McDbEntity.drawOrder

set drawOrder(order): void

对象的显示顺序

Parameters

NameTypeDescription
ordernumber顺序值

Returns

void

Example

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

let ss = new MxCADSelectionSet();
if (!await ss.userSelect("\n选择对象")) return;
//得到当前图上对象的最大,小最显示顺序.
let minmaxOrder = MxCpp.getCurrentDatabase().currentSpace.getMinMaxDrawOrder();
// 把对象放到最上面。
let lOrder = minmaxOrder.maxDrawOrder + 1;
ss.forEach((id) => {
  let ent = id.getMcDbEntity();
  if (ent) {
    ent.drawOrder = lOrder;
  }
})

Inherited from

McDbEntity.drawOrder


dxf0

get dxf0(): string

得到对象的DXF组码的类型名,这个和AutoCAD中的DXF组码是一样。 比如直线的类型名为:McDbLine,DXF0组码值: LINE,DXF0组码值可以用来构造集时的类型过滤。

Returns

string

Inherited from

McDbEntity.dxf0


layer

get layer(): string

得到对象图层名

Returns

string

Inherited from

McDbEntity.layer

set layer(val): void

设置对象图层名

Parameters

NameTypeDescription
valstring图层名

Returns

void

Inherited from

McDbEntity.layer


layerId

get layerId(): McObjectId

获取图层ID对象

Returns

McObjectId

Inherited from

McDbEntity.layerId

set layerId(id): void

设置图层Id对象

Parameters

NameType
idMcObjectId

Returns

void

Inherited from

McDbEntity.layerId


linetype

get linetype(): string

得到对象线型名

Returns

string

Inherited from

McDbEntity.linetype

set linetype(val): void

设置对象线型名

Parameters

NameTypeDescription
valstring线型名

Returns

void

Inherited from

McDbEntity.linetype


linetypeId

get linetypeId(): McObjectId

获取实体对象线型ID

Returns

McObjectId

Inherited from

McDbEntity.linetypeId

set linetypeId(id): void

设置实体对象线型ID

Parameters

NameType
idMcObjectId

Returns

void

Inherited from

McDbEntity.linetypeId


linetypeScale

get linetypeScale(): number

得到对象线型比例

Returns

number

Inherited from

McDbEntity.linetypeScale

set linetypeScale(val): void

设置对象线型比例

Parameters

NameTypeDescription
valnumber线型比例

Returns

void

Inherited from

McDbEntity.linetypeScale


lineweight

get lineweight(): number

得到对象线重

Returns

number

Inherited from

McDbEntity.lineweight

set lineweight(val): void

设置对象线重

Parameters

NameTypeDescription
valnumber线重

Returns

void

Inherited from

McDbEntity.lineweight


normal

get normal(): McGeVector3d

返回对象的normal

Returns

McGeVector3d

Inherited from

McDbEntity.normal

set normal(val): void

设置对象的normal

Parameters

NameType
valMcGeVector3d

Returns

void

Inherited from

McDbEntity.normal


objectName

get objectName(): string

获取对象名称。

Returns

string

返回对象名

Inherited from

McDbEntity.objectName


textStyle

get textStyle(): string

得到对象文字样式

Returns

string

Inherited from

McDbEntity.textStyle

set textStyle(val): void

设置对象文字样式

Parameters

NameTypeDescription
valstring文字样式名

Returns

void

Inherited from

McDbEntity.textStyle


textStyleId

get textStyleId(): McObjectId

获取实体文字样式

Returns

McObjectId

Inherited from

McDbEntity.textStyleId

set textStyleId(id): void

设置实体的文字样式

Parameters

NameType
idMcObjectId

Returns

void

Example

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

let selEntity = new MxCADUiPrEntity();
selEntity.setMessage("选择对象");
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

McDbEntity.textStyleId


thickness

get thickness(): number

得到对象厚度

Returns

number

Inherited from

McDbEntity.thickness

set thickness(val): void

设置对象厚度

Parameters

NameType
valnumber

Returns

void

Inherited from

McDbEntity.thickness


trueColor

get trueColor(): McCmColor

得到对象颜色

Returns

McCmColor

Inherited from

McDbEntity.trueColor

set trueColor(val): void

设置对象颜色

Parameters

NameType
valMcCmColor

Returns

void

Inherited from

McDbEntity.trueColor


visible

get visible(): boolean

对象是否可见

Returns

boolean

Inherited from

McDbEntity.visible

set visible(val): void

设置是否可见

Parameters

NameTypeDescription
valboolean布尔值

Returns

void

Inherited from

McDbEntity.visible

Methods

IntersectWith

IntersectWith(intersectObject, exOption): McGePoint3dArray

与其他实体相交, 得到交点

Parameters

NameTypeDescription
intersectObjectMcDbEntity需要相交的是实体对象
exOptionIntersect相交的选项

Returns

McGePoint3dArray

得到所有交点

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

McDbEntity.IntersectWith


assertObjectModification

assertObjectModification(autoUndo?): number

设置对象被改变的状态,可自动触发更新显示函数,更新显示。 比如块表记录更新了,需要通知块引用更新显示,可以调用该函数。

Parameters

NameTypeDefault valueDescription
autoUndobooleanfalse这次修改是否要自动支持撤销,默认为false

Returns

number

Inherited from

McDbEntity.assertObjectModification


clipBoundary

clipBoundary(): McGePoint3dArray

获取图像对象的裁剪边界

Returns

McGePoint3dArray


clipBoundaryType

clipBoundaryType(): ClipBoundaryType

获取裁剪边界的类型

Returns

ClipBoundaryType


clone

clone(): null | McDbObject

克隆对象。

Returns

null | McDbObject

克隆出的对象。

Inherited from

McDbEntity.clone


createExtensionDictionary

createExtensionDictionary(): boolean

创建对象的扩展字典数据.

Returns

boolean

Inherited from

McDbEntity.createExtensionDictionary


deleteXData

deleteXData(appName): boolean

删除实体指定应用程序名称相关的数据

Parameters

NameTypeDescription
appNamestring扩展数据名称

Returns

boolean

Example

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

let selEntity = new MxCADUiPrEntity();
selEntity.setMessage("选择对象");
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){
  //删除成功
}else
  //删除失败
}

Inherited from

McDbEntity.deleteXData


disableDisplay

disableDisplay(isDisable): void

禁用对象的自动更新显示.

Parameters

NameTypeDescription
isDisableboolean是否禁用对象自动更新显示

Returns

void

Inherited from

McDbEntity.disableDisplay


erase

erase(): boolean

删除对象。

Returns

boolean

是否删除成功。

Inherited from

McDbEntity.erase


explode

explode(): MxCADResbuf

打碎对象,返回打后对象数据链表

Returns

MxCADResbuf

resbuf 数据

Example

ts
import { McDbEntity, MxCADResbuf } from "mxcad";
// 获取目标对象
let getEnt = new MxCADUiPrEntity();
getEnt.setMessage("选择打碎对象:");
let id = await getEnt.go();
let ent:McDbEntity = id.getMcDbEntity();
if (ent === null) return;
// 打碎对象
      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

McDbEntity.explode


getAllAppName

getAllAppName(): McGeStringArray

获取实体中包含的所有 XData 记录的应用程序名(AppName)

Returns

McGeStringArray

Inherited from

McDbEntity.getAllAppName


getArea

getArea(): Object

计算面积

Returns

Object

val 面积值 | ret 是否获取成功

NameType
retboolean
valnumber

Example

ts
import { McGePoint3d, McDbCircle } from "mxcad"

const circle = new McDbCircle(0,0,0, 20);
const area = circle.getArea();
console.log("圆面积:", area)

Inherited from

McDbEntity.getArea


getBoundingBox

getBoundingBox(): Object

得到对象的最小外包

Returns

Object

NameType
maxPtMcGePoint3d
minPtMcGePoint3d
retboolean

Inherited from

McDbEntity.getBoundingBox


getDatabase

getDatabase(): McDbDatabase

得到对象所在的数据库

Returns

McDbDatabase

返回数据库

Inherited from

McDbEntity.getDatabase


getDatabaseIndexId

getDatabaseIndexId(): number

获取对象的索引ID

Returns

number

Inherited from

McDbEntity.getDatabaseIndexId


getDwgImageSize

getDwgImageSize(): number[]

返回dwg文件中的图片的宽高像素。

Returns

number[]


getExtensionDictionary

getExtensionDictionary(): McDbDictionary

得到对象的扩展字典数据.

Returns

McDbDictionary

扩展字典数据

Inherited from

McDbEntity.getExtensionDictionary


getGripEditBasePointsIndex

getGripEditBasePointsIndex(): number[]

获取对象的夹点对应的编辑基点索引。

Returns

number[]

Inherited from

McDbEntity.getGripEditBasePointsIndex


getGripPoints

getGripPoints(): McGePoint3dArray

获取对象的夹点数组

Returns

McGePoint3dArray

Inherited from

McDbEntity.getGripPoints


getHandle

getHandle(): string

得到对象句柄

Returns

string

返回对象句柄

Inherited from

McDbEntity.getHandle


getImp

getImp(): any

获取内部实现对象。

Returns

any

内部实现对象。

Inherited from

McDbEntity.getImp


getJson

getJson(): string

获取 JSON 格式的字符串。

Returns

string

JSON 格式的字符串。

Inherited from

McDbEntity.getJson


getObjectID

getObjectID(): McObjectId

获取对象 ID。

Returns

McObjectId

对象 ID。

Inherited from

McDbEntity.getObjectID


getOrientation

getOrientation(): Object

获取图像的方向

Returns

Object

origin: 原点 | uCorner: 沿X轴的向量 | vOnPlane: 沿Y轴的向量

NameType
originMcGePoint3d
uCornerMcGeVector3d
vOnPlaneMcGeVector3d

Example

ts
//假设 rasterImage 为光栅图片实例
const orientation = rasterImage.getOrientation();
console.log(orientation.origin); // 输出原点
console.log(orientation.uCorner); // 输出沿X轴的向量
console.log(orientation.vOnPlane); // 输出沿Y轴的向量

getOwnerID

getOwnerID(): number

得到对象拥用者的id

Returns

number

Inherited from

McDbEntity.getOwnerID


getxData

getxData(appName?): MxCADResbuf

得到对象的扩展数据

Parameters

NameTypeDefault valueDescription
appNamestring""扩展数据名

Returns

MxCADResbuf

Inherited from

McDbEntity.getxData


getxDataDouble

getxDataDouble(appName): Object

获取实体的指定 XData 类型中的 double 值

Parameters

NameTypeDescription
appNamestring扩展数据名称

Returns

Object

double 值

NameType
retboolean
valnumber

Inherited from

McDbEntity.getxDataDouble


getxDataLong

getxDataLong(appName): Object

获取实体的指定 XData 类型中的 long(整数)值

Parameters

NameTypeDescription
appNamestring扩展数据名称

Returns

Object

long 值

NameType
retboolean
valnumber

Inherited from

McDbEntity.getxDataLong


getxDataPoint

getxDataPoint(appName): Object

获取实体的指定 XData 类型中的点对象

Parameters

NameTypeDescription
appNamestring扩展数据名称

Returns

Object

获取结果及三维点对象

NameType
retboolean
valMcGePoint3d

Inherited from

McDbEntity.getxDataPoint


getxDataString

getxDataString(appName): Object

获取与特定实体关联的 XData 信息,并以字符串形式返回

Parameters

NameTypeDescription
appNamestring扩展数据名称

Returns

Object

val XData信息 | ret 是否返回成功

NameType
retboolean
valstring

Inherited from

McDbEntity.getxDataString


highlight

highlight(isHighlight): void

设置对象是否高亮

Parameters

NameTypeDescription
isHighlightboolean是否高亮

Returns

void

Inherited from

McDbEntity.highlight


imageDefId

imageDefId(): McObjectId

获取图像的定义ID

Returns

McObjectId


initTempObject

initTempObject(imp): void

初始化临时对象。

Parameters

NameTypeDescription
impany内部实现对象。

Returns

void

Inherited from

McDbEntity.initTempObject


isClip

isClip(): boolean

图片是否使用剪切边界

Returns

boolean


isErased

isErased(): boolean

对象是否已经删除

Returns

boolean

Inherited from

McDbEntity.isErased


isHaveExtensionDictionary

isHaveExtensionDictionary(): boolean

是否有扩展字典数据.

Returns

boolean

Inherited from

McDbEntity.isHaveExtensionDictionary


isKindOf

isKindOf(sObjectName): boolean

判断对象类型

Parameters

NameTypeDescription
sObjectNamestring类型名

Returns

boolean

返回对象是否是目标类型

Inherited from

McDbEntity.isKindOf


isNull

isNull(): any

判断是否为空对象

Returns

any

Inherited from

McDbEntity.isNull


mirror

mirror(point1, point2): boolean

镜向对象

Parameters

NameTypeDescription
point1McGePoint3d镜像基点
point2McGePoint3d-

Returns

boolean

Inherited from

McDbEntity.mirror


move

move(fromPoint, toPoint): boolean

移动对象

Parameters

NameTypeDescription
fromPointMcGePoint3d移动开始点
toPointMcGePoint3d移动结束点

Returns

boolean

Inherited from

McDbEntity.move


moveGripPointsAt

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

移动对象的夹点

Parameters

NameTypeDescription
iIndexnumber索引
dXOffsetnumberX轴偏移量
dYOffsetnumberY轴偏移量
dZOffsetnumberZ轴偏移量

Returns

any

Inherited from

McDbEntity.moveGripPointsAt


rotate

rotate(basePoint, dRotationAngle): boolean

旋转对象

Parameters

NameTypeDescription
basePointMcGePoint3d旋转基点
dRotationAnglenumber旋转角度

Returns

boolean

Inherited from

McDbEntity.rotate


scaleEntity

scaleEntity(basePoint, dScaleFactor): boolean

缩放对象

Parameters

NameTypeDescription
basePointMcGePoint3d缩放基点
dScaleFactornumber缩放因子(<1 缩小; >1 放大)

Returns

boolean

Inherited from

McDbEntity.scaleEntity


setClip

setClip(isClip): void

设置图片使用剪切边界

Parameters

NameType
isClipboolean

Returns

void


setClipBoundary

setClipBoundary(type, aryPoint, isWroldCoords?): boolean

设置图像对象的裁剪边界

Parameters

NameTypeDefault valueDescription
typeClipBoundaryTypeundefined裁剪边界的类型
aryPointMcGePoint3dArrayundefined裁剪边界点数组
isWroldCoordsbooleanfalse-

Returns

boolean

返回一个布尔值,指示设置是否成功。

Example

ts
// 图片裁剪
   import { MxCpp, McGePoint3d, McDb, McGePoint3dArray, McDbCircle, McDbPolyline, McDbRasterImage } from "mxcad";

   //画图片
   function drawImg() {
       const mxcad = MxCpp.getCurrentMxCAD();
       // 创建新画布
       mxcad.newFile();
       
       //图片插入点
       const pt = new McGePoint3d(0, 0, 0)
       //图片地址
       let imagUrl = "https://cdn.pixabay.com/photo/2022/11/15/12/23/winter-7593872_960_720.jpg";
       mxcad.loadImage(imagUrl, (image) => {
           if (!image) {
               console.log("loadImage failed");
               return;
           }
           let width = mxcad.mxdraw.viewCoordLong2Cad(100);
           let height = (image.height / image.width) * width;
           const id = mxcad.drawImage((pt as any).x, (pt as any).y, width, height, 0, imagUrl, true, image.width, image.height);
           const ent = id.getMcDbEntity() as McDbRasterImage;
           const { minPt, maxPt } = ent.getBoundingBox()
           const insertPt = minPt.clone().addvec(maxPt.sub(minPt).mult(1 / 2))
           // 设置一个圆做它的剪切边界.
           let dR = maxPt.x = minPt.y;
           if (dR < (maxPt.y - minPt.y)) dR = maxPt.y - minPt.y;
           dR *= 0.3;
           let circle = new McDbCircle(insertPt.x, insertPt.y, 0, dR);
           let samplePoints = circle.getSamplePoints(dR * 0.00001);
           let aryPoint = new McGePoint3dArray();

           samplePoints.forEach((val, _type, dxf) => {
               if (dxf === 1010) {
                   const point = new McGePoint3d(val.x, val.y, val.z)
                   aryPoint.append(point);
               }
           });
           ent.setClipBoundary(McDb.ClipBoundaryType.kPoly, aryPoint, true);
           ent.setClip(true);
           mxcad.drawEntity(circle);
           mxcad.updateDisplay();
       });
   };

setDwgImageSize

setDwgImageSize(width, height): boolean

设置保存dwg文件时,图片的宽高像素。

Parameters

NameType
widthnumber
heightnumber

Returns

boolean


setImageDefId

setImageDefId(imageId): void

设置图像的定义ID

Parameters

NameTypeDescription
imageIdMcObjectId图像的定义 ID

Returns

void

Example

ts
import { MxCpp, } from "mxcad";

// 插入图片
   function Mx_Test_ModifyImage() {
       if (!idImage) return;
       let mxcad = MxCpp.getCurrentMxCAD();
       let imagUrl = "https://cdn.pixabay.com/photo/2022/11/15/12/23/winter-7593872_960_720.jpg";
       mxcad.loadImage(imagUrl, (imagedata) => {
           if (!imagedata) {
               console.log("loadImage failed");
               return;
           }
           let imagedefid = mxcad.addImageDefine(imagUrl, "winter-7593872_960_720.jpg", true);
           let image = idImage.getMcDbEntity() as McDbRasterImage;
           if (image) {
               image.setImageDefId(imagedefid);
           }
           mxcad.updateDisplay();
       });
   }

setJson

setJson(str): boolean

设置 JSON 格式的字符串。

Parameters

NameTypeDescription
strstringJSON 格式的字符串。

Returns

boolean

是否设置成功。

Inherited from

McDbEntity.setJson


setOrientation

setOrientation(origin, uCorner, vOnPlane): boolean

设置或获取图像的方向

Parameters

NameTypeDescription
originMcGePoint3d原点
uCornerMcGeVector3d沿X轴的向量
vOnPlaneMcGeVector3d沿Y轴的向量

Returns

boolean

返回一个布尔值,指示设置是否成功

Example

ts
import { McDbRasterImage, McGePoint3d, McGeVector3d } from "mxcad";

const rasterImage = new McDbRasterImage();
const origin = new McGePoint3d(0, 0, 0);
const uCorner = McGeVector3d.kXAxis.clone();
const vOnPlane = McGeVector3d.kYAxis.clone();
const isSuccess = rasterImage.setOrientation(origin, uCorner, vOnPlane);
if(isSuccess){
  // 设置失败
}else{
  //设置成功
}

setxData

setxData(xdata): boolean

设置对象的扩展数据

Parameters

NameTypeDescription
xdataMxCADResbuf扩展数据链表

Returns

boolean

Example

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

//设置扩展数据
let selEntity = new MxCADUiPrEntity();
selEntity.setMessage("选择对象");
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

McDbEntity.setxData


setxDataDouble

setxDataDouble(appName, val): boolean

设置实体的指定 XData 类型中的 double 值

Parameters

NameTypeDescription
appNamestring扩展数据名称
valnumberdouble 值

Returns

boolean

布尔值

Example

ts
import { MxCADUiPrEntity, McDbEntity } from "mxcad";
let selEntity = new MxCADUiPrEntity();
selEntity.setMessage("选择对象");
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){
  //设置成功
}else{
  //设置失败
}

Inherited from

McDbEntity.setxDataDouble


setxDataLong

setxDataLong(appName, val): boolean

设置实体的指定 XData 类型中的 long(整数)值

Parameters

NameTypeDescription
appNamestring扩展数据名称
valnumberlong 值

Returns

boolean

long 值

Example

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

let selEntity = new MxCADUiPrEntity();
selEntity.setMessage("选择对象");
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){
  //设置成功
}else{
  //设置失败
}

Inherited from

McDbEntity.setxDataLong


setxDataPoint

setxDataPoint(appName, val): boolean

设置实体的指定 XData 类型中的点对象

Parameters

NameTypeDescription
appNamestring扩展数据名称
valMcGePoint3d点对象

Returns

boolean

获取结果及三维点对象

Inherited from

McDbEntity.setxDataPoint


setxDataString

setxDataString(appName, val): boolean

设置与特定实体关联的 XData 信息,并以字符串形式设置

Parameters

NameTypeDescription
appNamestring扩展数据名称
valstring字符串值

Returns

boolean

是否设置成功

Inherited from

McDbEntity.setxDataString


syncData

syncData(_toCpp?): boolean

同步实体的数据。这个方法可能是在修改了实体的属性或者附加了新的数据之后调用的,以确保所有的改变都被正确地保存到实体的数据库记录中。

Parameters

NameTypeDefault valueDescription
_toCppbooleantrue是否同步数据

Returns

boolean

Inherited from

McDbEntity.syncData


transformBy

transformBy(transformationMatrix): boolean

变换对象

Parameters

NameTypeDescription
transformationMatrixMcGeMatrix3d变换矩阵

Returns

boolean

Inherited from

McDbEntity.transformBy


unErase

unErase(): boolean

反删除对象。

Returns

boolean

Inherited from

McDbEntity.unErase


updateDisplay

updateDisplay(): void

显示调用对象更新显示.

Returns

void

Inherited from

McDbEntity.updateDisplay