Skip to content

[mxcad_3d API Document](../README. md)/Mx3dDbDocument

Class: Mx3dDbDocument

Document class, inherited from Mx3dDbObject.

Hierarchy

Table of contents

Constructors

Methods

Constructors

constructor

new Mx3dDbDocument()

Constructor, used to initialize Mx3dDbDocument instance.

Overrides

Mx3dDbObject.constructor

Methods

abortCommand

abortCommand(): void

Suspend the current transaction.

Returns

void


addColorLabel

addColorLabel(theColor): Mx3dDbLabel

Add a new color label.

Parameters

NameTypeDescription
TheColor[Mx3dGeColor] (Mx3dGeColor. md)Color object

Returns

Mx3dDbLabel

Return the newly added color label object.


addShapeLabel

addShapeLabel(): Mx3dDbLabel

Add a new shape label.

Returns

Mx3dDbLabel

Return the newly added shape label object.


commitCommand

commitCommand(): boolean

Submit the current transaction.

Returns

boolean

Return a Boolean value indicating whether the submission was successful.


getAccessLabel

getAccessLabel(): Mx3dDbLabel

Obtain the access entry tag.

Returns

Mx3dDbLabel

Return the access entry label object.


getColorsLabel

getColorsLabel(): Mx3dDbLabel

Obtain the entrance color label.

Returns

Mx3dDbLabel

Return the entry color label object.


getDocName

getDocName(): string

Get the document name.

Returns

string

Returns a string of the document name.


getLayersLabel

getLayersLabel(): Mx3dDbLabel

Obtain the entry layer label.

Returns

Mx3dDbLabel

Return the entry layer label object.


getShapesLabel

getShapesLabel(): Mx3dDbLabel

Obtain the entrance shape label.

Returns

Mx3dDbLabel

Return the entrance shape label object.


getTopFreeLabels

getTopFreeLabels(): Mx3dDbLabel[]

Get a list of top free labels.

Returns

Mx3dDbLabel[]

Return an array of top-level free labels.


getView

getView(): Mx3dView

Retrieve the view object.

Returns

Mx3dView

Return the view object.


newCommand

newCommand(): void

Start a transaction.

Returns

void


read

read(theFile, theFormat): Promise<boolean>

Read the model file and parse it into a document.

Parameters

NameTypeDescription
theFile[File]( https://developer.mozilla.org/docs/Web/API/File )The file object to be read.
TheFormat[MxFormat] (../enums/MdGe. MxFormat. md)Model file format

Returns

Promise<boolean>

Return a Promise, parsed as a Boolean value, indicating success or failure.


readFile

readFile(theFilePath, theFormat): boolean

Parameters

NameType
theFilePathstring
theFormatMxFormat

Returns

boolean


redo

redo(): boolean

Redo the last revoked transaction.

Returns

boolean

Returns a Boolean value indicating whether the redo was successful.


removeComponent

removeComponent(theLabel): void

Delete the specified component.

Parameters

NameTypeDescription
TheLabel[Mx3dDbLabel] (Mx3dDbLabel. md)The label object to be deleted

Returns

void


removeShapeLabel

removeShapeLabel(theLabel): boolean

Delete the specified shape label.

Parameters

NameTypeDescription
TheLabel[Mx3dDbLabel] (Mx3dDbLabel. md)The shape label object to be deleted

Returns

boolean

Return a Boolean value indicating whether the deletion was successful.


undo

undo(): boolean

Revoke the transaction of the last record.

Returns

boolean

Return a Boolean value indicating whether the revocation was successful.


write

write(theFilePath, theFormat): boolean

Write the document to the specified path.

Parameters

NameTypeDescription
The FilePathstringfile path
TheFormat[MxFormat] (../enums/MdGe. MxFormat. md)File format

Returns

boolean

Returns a Boolean value indicating whether the write was successful.