Show / Hide Table of Contents

Class AttributeDefinition

Represents an attribute definition EntityObject.

Inheritance
System.Object
DxfObject
AttributeDefinition
Implements
System.ICloneable
IHasXData
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 AttributeDefinition : DxfObject, ICloneable, IHasXData
Remarks

AutoCad allows to have duplicate tags in the attribute definitions list, but this library does not. To have duplicate tags is not recommended in any way, since there will be now way to know which is the definition associated to the insert attribute.

Constructors

| Improve this Doc View Source

AttributeDefinition(String)

Initializes a new instance of the AttributeDefinition class.

Declaration
public AttributeDefinition(string tag)
Parameters
Type Name Description
System.String tag

Attribute identifier.

| Improve this Doc View Source

AttributeDefinition(String, TextStyle)

Initializes a new instance of the AttributeDefinition class.

Declaration
public AttributeDefinition(string tag, TextStyle style)
Parameters
Type Name Description
System.String tag

Attribute identifier.

TextStyle style

Attribute TextStyle.

| Improve this Doc View Source

AttributeDefinition(String, Double, TextStyle)

Initializes a new instance of the AttributeDefinition class.

Declaration
public AttributeDefinition(string tag, double textHeight, TextStyle style)
Parameters
Type Name Description
System.String tag

Attribute identifier.

System.Double textHeight

Height of the attribute definition text.

TextStyle style

Attribute TextStyle.

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

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 definition 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 definition 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 Block Owner { get; }
Property Value
Type Description
Block
| Improve this Doc View Source

Position

Gets or sets the attribute Vector3 in object coordinates.

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

Prompt

Gets or sets the attribute information text.

Declaration
public string Prompt { get; set; }
Property Value
Type Description
System.String
Remarks

This is the text prompt shown to introduce the attribute value when new Insert entities are inserted into the drawing.

| 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 identifier.

Declaration
public string Tag { get; }
Property Value
Type Description
System.String
Remarks

Even thought the official DXF documentation clearly says that the attribute definition tag cannot contain spaces, most programs seems to allow them, but I cannot guarantee that all will behave this way.

| 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 default 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.

| Improve this Doc View Source

XData

Gets the entity XDataDictionary.

Declaration
public XDataDictionary XData { get; }
Property Value
Type Description
XDataDictionary

Methods

| Improve this Doc View Source

Clone()

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

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

A new AttributeDefinition 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

OnXDataAddAppRegEvent(ApplicationRegistry)

Declaration
protected virtual void OnXDataAddAppRegEvent(ApplicationRegistry item)
Parameters
Type Name Description
ApplicationRegistry item
| Improve this Doc View Source

OnXDataRemoveAppRegEvent(ApplicationRegistry)

Declaration
protected virtual void OnXDataRemoveAppRegEvent(ApplicationRegistry item)
Parameters
Type Name Description
ApplicationRegistry item
| Improve this Doc View Source

TransformBy(Matrix3, Vector3)

Moves, scales, and/or rotates the current attribute definition 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 AttributeDefinition.LayerChangedEventHandler LayerChanged
Event Type
Type Description
AttributeDefinition.LayerChangedEventHandler
| Improve this Doc View Source

LinetypeChanged

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

TextStyleChange

Declaration
public event AttributeDefinition.TextStyleChangedEventHandler TextStyleChange
Event Type
Type Description
AttributeDefinition.TextStyleChangedEventHandler
| Improve this Doc View Source

XDataAddAppReg

Declaration
public event XDataAddAppRegEventHandler XDataAddAppReg
Event Type
Type Description
XDataAddAppRegEventHandler
| Improve this Doc View Source

XDataRemoveAppReg

Declaration
public event XDataRemoveAppRegEventHandler XDataRemoveAppReg
Event Type
Type Description
XDataRemoveAppRegEventHandler

Implements

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