Skip to content

mxcad_3d API 文档 / Mx3dDbLabel

Class: Mx3dDbLabel ​

文档标签类,继承自 Mx3dDbObject,提供对标签的各种操作。

Hierarchy ​

Table of contents ​

Methods ​

Methods ​

addChildLabel ​

▸ addChildLabel(): Mx3dDbLabel

添加一个子标签。

Returns ​

Mx3dDbLabel

返回新增的子标签对象。


addComponent ​

▸ addComponent(comp, Loc): Mx3dDbLabel

添加一个组件。

Parameters ​

NameTypeDescription
compMx3dDbLabel组件标签对象。
LocMx3dGeLocation位置对象。

Returns ​

Mx3dDbLabel

返回添加的组件标签对象。


addSubShape ​

▸ addSubShape(theShape): Mx3dDbLabel

添加一个子形状。

Parameters ​

NameTypeDescription
theShapeMx3dShapeObject形状对象。

Returns ​

Mx3dDbLabel

返回新增的子标签对象。


getAttributeStr ​

▸ getAttributeStr(): string

获取标签属性字符串,JSON字符串。

Returns ​

string

返回标签属性字符串。


getChildLabels ​

▸ getChildLabels(): Mx3dDbLabel[]

获取所有子标签。

Returns ​

Mx3dDbLabel[]

返回子标签的数组。


getColor ​

▸ getColor(): Mx3dGeColor

获取标签颜色。

Returns ​

Mx3dGeColor

返回颜色对象。


getEntry ​

▸ getEntry(): string

获取标签条目,是一个唯一的数字字符序列。

Returns ​

string

返回标签条目的字符串。


getLocation ​

▸ getLocation(): Mx3dGeLocation

获取标签的位置。

Returns ​

Mx3dGeLocation

返回位置对象。


getName ​

▸ getName(): string

获取标签名称。

Returns ​

string

返回标签名称的字符串。


getParentLabel ​

▸ getParentLabel(): Mx3dDbLabel

获取父标签。

Returns ​

Mx3dDbLabel

返回父标签对象。


getReferredLabel ​

▸ getReferredLabel(): Mx3dDbLabel

获取引用的标签。

Returns ​

Mx3dDbLabel

返回引用的标签对象。


getShape ​

▸ getShape(): Mx3dShapeObject

获取标签的形状。

Returns ​

Mx3dShapeObject

返回形状对象。


hasChildLabel ​

▸ hasChildLabel(): boolean

检查标签是否有子标签。

Returns ​

boolean

返回布尔值,表示是否有子标签。


hasParentLabel ​

▸ hasParentLabel(): boolean

检查标签是否有父标签。

Returns ​

boolean

返回布尔值,表示是否有父标签。


hasShape ​

▸ hasShape(): boolean

检查标签是否有形状。

Returns ​

boolean

返回布尔值,表示是否有形状。


isAssembly ​

▸ isAssembly(): boolean

检查标签是否是装配。

Returns ​

boolean

返回布尔值,表示是否是装配。


isComponent ​

▸ isComponent(): boolean

检查标签是否是组件。

Returns ​

boolean

返回布尔值,表示是否是组件。


isCompound ​

▸ isCompound(): boolean

检查标签是否是复合形状。

Returns ​

boolean

返回布尔值,表示是否是复合形状。


isFree ​

▸ isFree(): boolean

检查标签是否是自由标签。

Returns ​

boolean

返回布尔值,表示是否是自由标签。


isReference ​

▸ isReference(): boolean

检查标签是否是引用。

Returns ​

boolean

返回布尔值,表示是否是引用。


isSetColor ​

▸ isSetColor(): boolean

检查标签是否设置了颜色。

Returns ​

boolean

返回布尔值,表示是否设置了颜色。


isShape ​

▸ isShape(): boolean

检查标签是否是形状。

Returns ​

boolean

返回布尔值,表示是否是形状。


isSimpleShape ​

▸ isSimpleShape(): boolean

检查标签是否是简单形状。

Returns ​

boolean

返回布尔值,表示是否是简单形状。


isSubShape ​

▸ isSubShape(): boolean

检查标签是否是子形状。

Returns ​

boolean

返回布尔值,表示是否是子形状。


isTopLevel ​

▸ isTopLevel(): boolean

检查标签是否是顶级标签。

Returns ​

boolean

返回布尔值,表示是否是顶级标签。


setColor ​

▸ setColor(theColor): void

设置标签颜色。

Parameters ​

NameTypeDescription
theColorMx3dGeColor颜色对象。

Returns ​

void


setMaterial ​

▸ setMaterial(theMaterial): void

设置标签形状的材质。

Parameters ​

NameTypeDescription
theMaterialMx3dGeMaterial材质对象。

Returns ​

void


setName ​

▸ setName(theName): void

设置标签名称。

Parameters ​

NameTypeDescription
theNamestring标签名称。

Returns ​

void


setShape ​

▸ setShape(theShape): void

设置标签的形状。

Parameters ​

NameTypeDescription
theShapeMx3dShapeObject形状对象。

Returns ​

void


setTexture ​

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

设置标签形状的纹理。

Parameters ​

NameTypeDefault valueDescription
theFilePathstringundefined纹理文件路径。
theScaleUnumber1U 方向缩放比例,默认值为 1。
theScaleVnumber1V 方向缩放比例,默认值为 1。
theRepeatUnumber1U 方向重复次数,默认值为 1。
theRepeatVnumber1V 方向重复次数,默认值为 1。
theOriginUnumber0U 方向起始位置,默认值为 0。
theOriginVnumber0V 方向起始位置,默认值为 0。

Returns ​

void