Skip to content

mxcad_3d API 文档 / Mx3dDbDocument

Class: Mx3dDbDocument ​

文档类,继承自 Mx3dDbObject。

Hierarchy ​

Table of contents ​

Constructors ​

Methods ​

Constructors ​

constructor ​

• new Mx3dDbDocument()

构造函数,用于初始化 Mx3dDbDocument 实例。

Overrides ​

Mx3dDbObject.constructor

Methods ​

abortCommand ​

▸ abortCommand(): void

中止当前事务。

Returns ​

void


addColorLabel ​

▸ addColorLabel(theColor): Mx3dDbLabel

添加一个新的颜色标签。

Parameters ​

NameTypeDescription
theColorMx3dGeColor颜色对象。

Returns ​

Mx3dDbLabel

返回新增的颜色标签对象。


addShapeLabel ​

▸ addShapeLabel(): Mx3dDbLabel

添加一个新的形状标签。

Returns ​

Mx3dDbLabel

返回新增的形状标签对象。


commitCommand ​

▸ commitCommand(): boolean

提交当前事务。

Returns ​

boolean

返回布尔值,表示是否成功提交。


getAccessLabel ​

▸ getAccessLabel(): Mx3dDbLabel

获取访问入口标签。

Returns ​

Mx3dDbLabel

返回访问入口标签对象。


getColorsLabel ​

▸ getColorsLabel(): Mx3dDbLabel

获取入口颜色标签。

Returns ​

Mx3dDbLabel

返回入口颜色标签对象。


getDocName ​

▸ getDocName(): string

获取文档名称。

Returns ​

string

返回文档名称的字符串。


getLayersLabel ​

▸ getLayersLabel(): Mx3dDbLabel

获取入口图层标签。

Returns ​

Mx3dDbLabel

返回入口图层标签对象。


getShapesLabel ​

▸ getShapesLabel(): Mx3dDbLabel

获取入口形状标签。

Returns ​

Mx3dDbLabel

返回入口形状标签对象。


getTopFreeLabels ​

▸ getTopFreeLabels(): Mx3dDbLabel[]

获取顶级自由标签列表。

Returns ​

Mx3dDbLabel[]

返回顶级自由标签的数组。


getView ​

▸ getView(): Mx3dView

获取视图对象。

Returns ​

Mx3dView

返回视图对象。


newCommand ​

▸ newCommand(): void

开启一个事务开始。

Returns ​

void


read ​

▸ read(theFile, theFormat): Promise<boolean>

读取模型文件并解析为文档。

Parameters ​

NameTypeDescription
theFileFile要读取的文件对象。
theFormatMxFormat模型文件格式。

Returns ​

Promise<boolean>

返回一个 Promise,解析结果为布尔值,表示成功或失败。


readFile ​

▸ readFile(theFilePath, theFormat): boolean

Parameters ​

NameType
theFilePathstring
theFormatMxFormat

Returns ​

boolean


redo ​

▸ redo(): boolean

重做最后一个撤销的事务。

Returns ​

boolean

返回布尔值,表示是否成功重做。


removeComponent ​

▸ removeComponent(theLabel): void

删除指定的组件。

Parameters ​

NameTypeDescription
theLabelMx3dDbLabel要删除的标签对象。

Returns ​

void


removeShapeLabel ​

▸ removeShapeLabel(theLabel): boolean

删除指定的形状标签。

Parameters ​

NameTypeDescription
theLabelMx3dDbLabel要删除的形状标签对象。

Returns ​

boolean

返回布尔值,表示是否成功删除。


undo ​

▸ undo(): boolean

撤销最后一个记录的事务。

Returns ​

boolean

返回布尔值,表示是否成功撤销。


write ​

▸ write(theFilePath, theFormat): boolean

写入文档到指定路径。

Parameters ​

NameTypeDescription
theFilePathstring文件路径。
theFormatMxFormat文件格式。

Returns ​

boolean

返回布尔值,表示是否成功写入。