Show / Hide Table of Contents

Class Attribute

Represents a attribute EntityObject.

Inheritance
System.Object
DxfObject
Attribute
Implements
System.ICloneable
Inherited Members
DxfObject.CodeName
DxfObject.Handle
DxfObject.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: netDxf.Entities
Assembly: CADability.dll
Syntax
public class Attribute : DxfObject, ICloneable
Remarks

The attribute position, rotation, height and width factor values also includes the transformation of the Insert entity to which it belongs.
During the attribute initialization a copy of all attribute definition properties will be copied, so any changes made to the attribute definition will only be applied to new attribute instances and not to existing ones. This behavior is to allow imported Insert entities to have attributes without definition in the block, although this might sound not totally correct it is allowed by AutoCad.

Constructors

| Improve this Doc View Source

Attribute(AttributeDefinition)

Initializes a new instance of the Attribute class.

Declaration
public Attribute(AttributeDefinition definition)
Parameters
Type Name Description
AttributeDefinition definition

AttributeDefinition.

Properties

| Improve this Doc View Source

Alignment

Gets or sets the text alignment.

Declaration
public TextAlignment Alignment { get; set; }
Property Value
Type Description
TextAlignment
| Improve this Doc View Source

Color

Gets or sets the entity AciColor.

Declaration
public AciColor Color { get; set; }
Property Value
Type Description
AciColor
| Improve this Doc View Source

Definition

Gets the attribute definition.

Declaration
public AttributeDefinition Definition { get; }
Property Value
Type Description
AttributeDefinition
Remarks

If the insert attribute has no definition it will return null.

| Improve this Doc View Source

Flags

Gets or sets the attribute flags.

Declaration
public AttributeFlags Flags { get; set; }
Property Value
Type Description
AttributeFlags
| Improve this Doc View Source

Height

Gets or sets the text height.

Declaration
public double Height { get; set; }
Property Value
Type Description
System.Double
Remarks

Valid values must be greater than zero. Default: 1.0.
When Alignment.Aligned is used this value is not applicable, it will be automatically adjusted so the text will fit in the specified width.

| Improve this Doc View Source

IsBackward

Gets or sets if the attribute text is backward (mirrored in X).

Declaration
public bool IsBackward { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

IsUpsideDown

Gets or sets if the attribute text is upside down (mirrored in Y).

Declaration
public bool IsUpsideDown { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

IsVisible

Gets or set the entity visibility.

Declaration
public bool IsVisible { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Layer

Gets or sets the entity Layer.

Declaration
public Layer Layer { get; set; }
Property Value
Type Description
Layer
| Improve this Doc View Source

Linetype

Gets or sets the entity Linetype.

Declaration
public Linetype Linetype { get; set; }
Property Value
Type Description
Linetype
| Improve this Doc View Source

LinetypeScale

Gets or sets the entity line type scale.

Declaration
public double LinetypeScale { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Lineweight

Gets or sets the entity line weight, one unit is always 1/100 mm (default = ByLayer).

Declaration
public Lineweight Lineweight { get; set; }
Property Value
Type Description
Lineweight
| Improve this Doc View Source

Normal

Gets or sets the entity Vector3.

Declaration
public Vector3 Normal { get; set; }
Property Value
Type Description
Vector3
| Improve this Doc View Source

ObliqueAngle

Gets or sets the font oblique angle.

Declaration
public double ObliqueAngle { get; set; }
Property Value
Type Description
System.Double
Remarks

Valid values range from -85 to 85. Default: 0.0.

| Improve this Doc View Source

Owner

Gets the owner of the actual DXF object.

Declaration
public Insert Owner { get; }
Property Value
Type Description
Insert
| Improve this Doc View Source

Position

Gets or sets the attribute Vector3.

Declaration
public Vector3 Position { get; set; }
Property Value
Type Description
Vector3
| Improve this Doc View Source

Rotation

Gets or sets the attribute text rotation in degrees.

Declaration
public double Rotation { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Style

Gets or sets the attribute text style.

Declaration
public TextStyle Style { get; set; }
Property Value
Type Description
TextStyle
Remarks

The TextStyle defines the basic properties of the information text.

| Improve this Doc View Source

Tag

Gets the attribute tag.

Declaration
public string Tag { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

Transparency

Gets or sets layer transparency (default: ByLayer).

Declaration
public Transparency Transparency { get; set; }
Property Value
Type Description
Transparency
| Improve this Doc View Source

Value

Gets or sets the attribute value.

Declaration
public object Value { get; set; }
Property Value
Type Description
System.Object
| Improve this Doc View Source

Width

Gets or sets the text width, only applicable for text Alignment.Fit and Alignment.Align.

Declaration
public double Width { get; set; }
Property Value
Type Description
System.Double
Remarks

Valid values must be greater than zero. Default: 1.0.

| Improve this Doc View Source

WidthFactor

Gets or sets the width factor.

Declaration
public double WidthFactor { get; set; }
Property Value
Type Description
System.Double
Remarks

Valid values range from 0.01 to 100. Default: 1.0.
When Alignment.Fit is used this value is not applicable, it will be automatically adjusted so the text will fit in the specified width.

Methods

| Improve this Doc View Source

Clone()

Creates a new Attribute that is a copy of the current instance.

Declaration
public object Clone()
Returns
Type Description
System.Object

A new Attribute that is a copy of this instance.

| Improve this Doc View Source

OnLayerChangedEvent(Layer, Layer)

Declaration
protected virtual Layer OnLayerChangedEvent(Layer oldLayer, Layer newLayer)
Parameters
Type Name Description
Layer oldLayer
Layer newLayer
Returns
Type Description
Layer
| Improve this Doc View Source

OnLinetypeChangedEvent(Linetype, Linetype)

Declaration
protected virtual Linetype OnLinetypeChangedEvent(Linetype oldLinetype, Linetype newLinetype)
Parameters
Type Name Description
Linetype oldLinetype
Linetype newLinetype
Returns
Type Description
Linetype
| Improve this Doc View Source

OnTextStyleChangedEvent(TextStyle, TextStyle)

Declaration
protected virtual TextStyle OnTextStyleChangedEvent(TextStyle oldTextStyle, TextStyle newTextStyle)
Parameters
Type Name Description
TextStyle oldTextStyle
TextStyle newTextStyle
Returns
Type Description
TextStyle
| Improve this Doc View Source

TransformBy(Matrix3, Vector3)

Moves, scales, and/or rotates the current attribute given a 3x3 transformation matrix and a translation vector.

Declaration
public void TransformBy(Matrix3 transformation, Vector3 translation)
Parameters
Type Name Description
Matrix3 transformation

Transformation matrix.

Vector3 translation

Translation vector.

Remarks

Matrix3 adopts the convention of using column vectors to represent a transformation matrix.

| Improve this Doc View Source

TransformBy(Matrix4)

Moves, scales, and/or rotates the current entity given a 4x4 transformation matrix.

Declaration
public void TransformBy(Matrix4 transformation)
Parameters
Type Name Description
Matrix4 transformation

Transformation matrix.

Remarks

Matrix4 adopts the convention of using column vectors to represent a transformation matrix.

Events

| Improve this Doc View Source

LayerChanged

Declaration
public event Attribute.LayerChangedEventHandler LayerChanged
Event Type
Type Description
Attribute.LayerChangedEventHandler
| Improve this Doc View Source

LinetypeChanged

Declaration
public event Attribute.LinetypeChangedEventHandler LinetypeChanged
Event Type
Type Description
Attribute.LinetypeChangedEventHandler
| Improve this Doc View Source

TextStyleChanged

Declaration
public event Attribute.TextStyleChangedEventHandler TextStyleChanged
Event Type
Type Description
Attribute.TextStyleChangedEventHandler

Implements

System.ICloneable
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX