mxcad_3d API 文档 / Mx3dDbLabel
Class: Mx3dDbLabel 
文档标签类,继承自 Mx3dDbObject,提供对标签的各种操作。
Hierarchy 
- ↳ - Mx3dDbLabel
Table of contents 
Methods 
- addChildLabel
- addComponent
- addSubShape
- getAttributeStr
- getChildLabels
- getColor
- getEntry
- getLocation
- getName
- getParentLabel
- getReferredLabel
- getShape
- hasChildLabel
- hasParentLabel
- hasShape
- isAssembly
- isComponent
- isCompound
- isFree
- isReference
- isSetColor
- isShape
- isSimpleShape
- isSubShape
- isTopLevel
- setColor
- setMaterial
- setName
- setShape
- setTexture
Methods 
addChildLabel 
▸ addChildLabel(): Mx3dDbLabel
添加一个子标签。
Returns 
返回新增的子标签对象。
addComponent 
▸ addComponent(comp, Loc): Mx3dDbLabel
添加一个组件。
Parameters 
| Name | Type | Description | 
|---|---|---|
| comp | Mx3dDbLabel | 组件标签对象。 | 
| Loc | Mx3dGeLocation | 位置对象。 | 
Returns 
返回添加的组件标签对象。
addSubShape 
▸ addSubShape(theShape): Mx3dDbLabel
添加一个子形状。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theShape | Mx3dShapeObject | 形状对象。 | 
Returns 
返回新增的子标签对象。
getAttributeStr 
▸ getAttributeStr(): string
获取标签属性字符串,JSON字符串。
Returns 
string
返回标签属性字符串。
getChildLabels 
▸ getChildLabels(): Mx3dDbLabel[]
获取所有子标签。
Returns 
返回子标签的数组。
getColor 
▸ getColor(): Mx3dGeColor
获取标签颜色。
Returns 
返回颜色对象。
getEntry 
▸ getEntry(): string
获取标签条目,是一个唯一的数字字符序列。
Returns 
string
返回标签条目的字符串。
getLocation 
▸ getLocation(): Mx3dGeLocation
获取标签的位置。
Returns 
返回位置对象。
getName 
▸ getName(): string
获取标签名称。
Returns 
string
返回标签名称的字符串。
getParentLabel 
▸ getParentLabel(): Mx3dDbLabel
获取父标签。
Returns 
返回父标签对象。
getReferredLabel 
▸ getReferredLabel(): Mx3dDbLabel
获取引用的标签。
Returns 
返回引用的标签对象。
getShape 
▸ getShape(): Mx3dShapeObject
获取标签的形状。
Returns 
返回形状对象。
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 
| Name | Type | Description | 
|---|---|---|
| theColor | Mx3dGeColor | 颜色对象。 | 
Returns 
void
setMaterial 
▸ setMaterial(theMaterial): void
设置标签形状的材质。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theMaterial | Mx3dGeMaterial | 材质对象。 | 
Returns 
void
setName 
▸ setName(theName): void
设置标签名称。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theName | string | 标签名称。 | 
Returns 
void
setShape 
▸ setShape(theShape): void
设置标签的形状。
Parameters 
| Name | Type | Description | 
|---|---|---|
| theShape | Mx3dShapeObject | 形状对象。 | 
Returns 
void
setTexture 
▸ setTexture(theFilePath, theScaleU?, theScaleV?, theRepeatU?, theRepeatV?, theOriginU?, theOriginV?): void
设置标签形状的纹理。
Parameters 
| Name | Type | Default value | Description | 
|---|---|---|---|
| theFilePath | string | undefined | 纹理文件路径。 | 
| theScaleU | number | 1 | U 方向缩放比例,默认值为 1。 | 
| theScaleV | number | 1 | V 方向缩放比例,默认值为 1。 | 
| theRepeatU | number | 1 | U 方向重复次数,默认值为 1。 | 
| theRepeatV | number | 1 | V 方向重复次数,默认值为 1。 | 
| theOriginU | number | 0 | U 方向起始位置,默认值为 0。 | 
| theOriginV | number | 0 | V 方向起始位置,默认值为 0。 | 
Returns 
void