Table of Contents

Class DxfAttributeDefinition

Namespace
GeometryHelper.Dxf
Assembly
GeometryHelper.dll

An ATTDEF of a DXF file, as AutoCAD's AttributeDefinition: an attribute of a block, the text an INSERT of the block is asked to give, named by its Tag, with its Prompt and default value.

public sealed class DxfAttributeDefinition : DxfDBText
Inheritance
DxfAttributeDefinition
Inherited Members

Remarks

The block BOLT whose ATTDEF has the tag TAG1, the prompt Size and the value M20 asks each INSERT of it for a size, M20 unless it is given another; TextString is that default, and every member of DxfDBText reads and sets its text as it does a TEXT's.

Its groups are read as ezdxf reads them: those of the text from its part AcDbText, the prompt, tag, flags, field length and vertical mode (group 74) from its part AcDbAttributeDefinition. new DxfAttributeDefinition(position, "M20", "TAG1", "Size", null) makes one in code, to be added to a block by AppendEntity(DxfEntity).

Constructors

DxfAttributeDefinition()

Initializes an attribute definition with no tag, prompt or value at the origin, 2.5 high, as AutoCAD's new AttributeDefinition(), in no file; give it its tag before it is added to a block.

DxfAttributeDefinition(GeoPoint3, string, string, string, DxfTextStyleTableRecord)

Initializes an attribute definition, as AutoCAD's new AttributeDefinition(position, value, tag, prompt, style): at a point, with its default value, tag and prompt, 2.5 high, in a text style, in no file until it is added to a block.

Properties

Constant

Gets or sets whether the attribute's value is fixed, the same in every INSERT (flag 2 of group 70), as AutoCAD's Constant.

FieldLength

Gets or sets the length of the attribute's field (group 73), as AutoCAD's FieldLength; nought where the record gives none.

Invisible

Gets or sets whether the attribute is not drawn (flag 1 of group 70), as AutoCAD's Invisible.

IsMTextAttributeDefinition

Gets or sets whether the attribute is a text of several lines, an MTEXT embedded in its record (group 101), as AutoCAD's IsMTextAttributeDefinition.

LockPositionInBlock

Gets or sets whether the attribute keeps its place in the block when the block is edited (the group 280 after its tag), as AutoCAD's LockPositionInBlock; false where the record gives none.

MTextAttributeDefinition

Gets or sets the MTEXT the definition is made of where it is of several lines, as AutoCAD's MTextAttributeDefinition: as MTextAttribute gets and sets one, its type (71) 4, as ezdxf writes the definition of an attribute of several lines, but its default value (group 1) the MTEXT's contents, its lines apart by \P, as AutoCAD 2021 writes the definition of three lines it makes: LINE ONE\PLINE TWO\PLINE THREE, where ezdxf writes the first line. TextString reads the words of its lines joined by spaces, LINE ONE LINE TWO LINE THREE, as AutoCAD 2021 reads them, and an ATTRIB filled from the definition is given those.

Preset

Gets or sets whether the attribute takes its default value without asking (flag 8 of group 70), as AutoCAD's Preset.

Prompt

Gets or sets what an INSERT of the block is asked for the attribute (group 3), as AutoCAD's Prompt; empty where the record gives none.

Tag

Gets or sets the tag of the attribute (group 2), as AutoCAD's Tag: the name an INSERT's ATTRIB of it has, such as TAG1.

Verifiable

Gets or sets whether the attribute's value is checked when it is given (flag 4 of group 70), as AutoCAD's Verifiable.

Methods

UpdateMTextAttributeDefinition()

Places the definition's MTEXT where its text stands, as AutoCAD's UpdateMTextAttributeDefinition, as UpdateMTextAttribute() places an attribute's; nothing for a definition of one line.