Skip to content

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

Class: Mx3dDbLabel ​

The document tag class inherits from Mx3dDbObject and provides various operations on tags.

Hierarchy ​

Table of contents ​

Methods ​

Methods ​

addChildLabel ​

▸ addChildLabel(): Mx3dDbLabel

Add a sub tag.

Returns ​

Mx3dDbLabel

Return the newly added sub label object.


addComponent ​

▸ addComponent(comp, Loc): Mx3dDbLabel

Add a component.

Parameters ​

NameTypeDescription
Comp[Mx3dDbLabel] (Mx3dDbLabel. md)Component label object
Loc[Mx3dGeLocation] (Mx3dGeLocation. md)Position object

Returns ​

Mx3dDbLabel

Return the added component label object.


addSubShape ​

▸ addSubShape(theShape): Mx3dDbLabel

Add a sub shape.

Parameters ​

NameTypeDescription
The Shape[Mx3dShapeObject] (Mx3dShapeObject. md)Shape object

Returns ​

Mx3dDbLabel

Return the newly added sub label object.


getAttributeStr ​

▸ getAttributeStr(): string

Get tag attribute string, JSON string.

Returns ​

string

Return the tag attribute string.


getChildLabels ​

▸ getChildLabels(): Mx3dDbLabel[]

Retrieve all sub tags.

Returns ​

Mx3dDbLabel[]

Return an array of sub tags.


getColor ​

▸ getColor(): Mx3dGeColor

Get the label color.

Returns ​

Mx3dGeColor

Return the color object.


getEntry ​

▸ getEntry(): string

Retrieve a tag entry, which is a unique sequence of numerical characters.

Returns ​

string

Return the string of the label entry.


getLocation ​

▸ getLocation(): Mx3dGeLocation

Retrieve the location of the label.

Returns ​

Mx3dGeLocation

Return the location object.


getName ​

▸ getName(): string

Get the tag name.

Returns ​

string

Returns a string of tag names.


getParentLabel ​

▸ getParentLabel(): Mx3dDbLabel

Get the parent tag.

Returns ​

Mx3dDbLabel

Return the parent label object.


getReferredLabel ​

▸ getReferredLabel(): Mx3dDbLabel

Retrieve the referenced label.

Returns ​

Mx3dDbLabel

Return the referenced label object.


getShape ​

▸ getShape(): Mx3dShapeObject

Obtain the shape of the label.

Returns ​

Mx3dShapeObject

Return the shape object.


hasChildLabel ​

▸ hasChildLabel(): boolean

Check if the label has sub labels.

Returns ​

boolean

Return a Boolean value indicating whether there are sub labels.


hasParentLabel ​

▸ hasParentLabel(): boolean

Check if the tag has a parent tag.

Returns ​

boolean

Returns a Boolean value indicating whether there is a parent label.


hasShape ​

▸ hasShape(): boolean

Check if the label has a shape.

Returns ​

boolean

Returns a Boolean value indicating whether there is a shape.


isAssembly ​

▸ isAssembly(): boolean

Check if the label is assembled.

Returns ​

boolean

Return a Boolean value indicating whether it is an assembly.


isComponent ​

▸ isComponent(): boolean

Check if the label is a component.

Returns ​

boolean

Returns a Boolean value indicating whether it is a component.


isCompound ​

▸ isCompound(): boolean

Check if the label is a composite shape.

Returns ​

boolean

Returns a Boolean value indicating whether it is a composite shape.


isFree ​

▸ isFree(): boolean

Check if the label is a free label.

Returns ​

boolean

Returns a Boolean value indicating whether it is a free label.


isReference ​

▸ isReference(): boolean

Check if the label is a reference.

Returns ​

boolean

Returns a Boolean value indicating whether it is a reference.


isSetColor ​

▸ isSetColor(): boolean

Check if the label has set the color.

Returns ​

boolean

Returns a Boolean value indicating whether a color has been set.


isShape ​

▸ isShape(): boolean

Check if the label is shaped.

Returns ​

boolean

Returns a Boolean value indicating whether it is a shape.


isSimpleShape ​

▸ isSimpleShape(): boolean

Check if the label has a simple shape.

Returns ​

boolean

Returns a Boolean value indicating whether it is a simple shape.


isSubShape ​

▸ isSubShape(): boolean

Check if the label is a sub shape.

Returns ​

boolean

Returns a Boolean value indicating whether it is a sub shape.


isTopLevel ​

▸ isTopLevel(): boolean

Check if the label is a top-level label.

Returns ​

boolean

Returns a Boolean value indicating whether it is a top-level label.


setColor ​

▸ setColor(theColor): void

Set label color.

Parameters ​

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

Returns ​

void


setMaterial ​

▸ setMaterial(theMaterial): void

Set the material for the label shape.

Parameters ​

NameTypeDescription
The Material[Mx3dGeMaterial. md]Material object

Returns ​

void


setName ​

▸ setName(theName): void

Set the label name.

Parameters ​

NameTypeDescription
TheNamestringLabel name

Returns ​

void


setShape ​

▸ setShape(theShape): void

Set the shape of the label.

Parameters ​

NameTypeDescription
The Shape[Mx3dShapeObject] (Mx3dShapeObject. md)Shape object

Returns ​

void


setTexture ​

▸ setTexture(theFilePath, theScaleU?, theScaleV?, theRepeatU?, theRepeatV?, theOriginU?, theOriginV?): void

Set the texture of the label shape.

Parameters ​

NameTypeDefault valueDescription
TheFilePathstringundefinedTexture file path
TheScaleUnumber1U-direction scaling ratio, default value is 1
TheScaleVnumber1V-direction scaling ratio, default value is 1
The RepeatUnumber1number of repetitions in the U direction, with a default value of 1
The RepeatVnumber1number of repetitions in the V direction, with a default value of 1
The OriginUnumber0U direction starting position, default value is 0
The OriginVnumber0starting position in the V direction, with a default value of 0

Returns ​

void