[mxcad_3d API Document](../README. md)/Mx3dDbLabel
Class: Mx3dDbLabel
The document tag class inherits from Mx3dDbObject and provides various operations on tags.
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
Add a sub tag.
Returns
Return the newly added sub label object.
addComponent
▸ addComponent(comp
, Loc
): Mx3dDbLabel
Add a component.
Parameters
Name | Type | Description |
---|---|---|
Comp | [Mx3dDbLabel] (Mx3dDbLabel. md) | Component label object |
Loc | [Mx3dGeLocation] (Mx3dGeLocation. md) | Position object |
Returns
Return the added component label object.
addSubShape
▸ addSubShape(theShape
): Mx3dDbLabel
Add a sub shape.
Parameters
Name | Type | Description |
---|---|---|
The Shape | [Mx3dShapeObject] (Mx3dShapeObject. md) | Shape object |
Returns
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
Return an array of sub tags.
getColor
▸ getColor(): Mx3dGeColor
Get the label color.
Returns
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
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
Return the parent label object.
getReferredLabel
▸ getReferredLabel(): Mx3dDbLabel
Retrieve the referenced label.
Returns
Return the referenced label object.
getShape
▸ getShape(): Mx3dShapeObject
Obtain the shape of the label.
Returns
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
Name | Type | Description |
---|---|---|
TheColor | [Mx3dGeColor] (Mx3dGeColor. md) | Color object |
Returns
void
setMaterial
▸ setMaterial(theMaterial
): void
Set the material for the label shape.
Parameters
Name | Type | Description |
---|---|---|
The Material | [Mx3dGeMaterial. md] | Material object |
Returns
void
setName
▸ setName(theName
): void
Set the label name.
Parameters
Name | Type | Description |
---|---|---|
TheName | string | Label name |
Returns
void
setShape
▸ setShape(theShape
): void
Set the shape of the label.
Parameters
Name | Type | Description |
---|---|---|
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
Name | Type | Default value | Description |
---|---|---|---|
TheFilePath | string | undefined | Texture file path |
TheScaleU | number | 1 | U-direction scaling ratio, default value is 1 |
TheScaleV | number | 1 | V-direction scaling ratio, default value is 1 |
The RepeatU | number | 1 | number of repetitions in the U direction, with a default value of 1 |
The RepeatV | number | 1 | number of repetitions in the V direction, with a default value of 1 |
The OriginU | number | 0 | U direction starting position, default value is 0 |
The OriginV | number | 0 | starting position in the V direction, with a default value of 0 |
Returns
void