Table of Contents

Class DxfField

Namespace
GeometryHelper.Dxf
Assembly
GeometryHelper.dll

A field of a DXF file, as AutoCAD's Field: a FIELD of the OBJECTS section, the code AutoCAD evaluates to the words a text shows, kept in the extension dictionary of the object it belongs to, in its dictionary ACAD_FIELD, and reached by GetField().

public sealed class DxfField : DxfDBObject
Inheritance
DxfField
Inherited Members

Remarks

A text with fields in it holds a text field, of the evaluator _text, whose code is the text with each field standing as %<\_FldIdx 0>%, %<\_FldIdx 1>% and on, the fields its children in that order (90 and 360). The TEXT that reads Drawn 27/10/2026, the date a field, has the text field of the code Drawn %<\_FldIdx 0>% and one child, of the evaluator AcVar and the code \AcVar Date \f "dd/MM/yyyy", and its GetTextWithFieldCodes() gives Drawn %<\AcVar Date \f "dd/MM/yyyy">%.

The library does not evaluate a field: the words of the text are those AutoCAD wrote when it last evaluated it, and GetStringValue() the value it kept. A field made in code, new DxfField("Drawn %<\\AcVar Date>%", true), and given to a text by SetField(DxfField), is written in the groups the DXF reference gives a FIELD, marked not evaluated (95 of 1) and to be evaluated whenever AutoCAD evaluates its fields (91 of 63), the text keeping its words until then. That layout has not been read by AutoCAD itself yet: the state (94 of 0), the empty value's flag (93 of 1) and, before R2007, the format (group 4 between 331 and 91, which libredwg reads in a DWG of that version and the library does not write) are the library's reading of the reference and of libredwg, to be checked on a drawing AutoCAD saved.

Constructors

DxfField(string)

Initializes a field made in code of the code of one field, as AutoCAD's Field(fieldCode): the code in its markers, %<\AcVar Date \f "dd/MM/yyyy">%, its evaluator the word after the backslash, AcVar, its code what the markers hold; to be given to an object by SetField(DxfField).

DxfField(string, bool)

Initializes a field made in code, as AutoCAD's Field(fieldCode, textField): of one field as DxfField(string), or, as a text field, of a text with fields in it, each field in its markers, its evaluator _text: new DxfField("Drawn %<\AcVar Date>% by %<\AcVar Login>%", true) is the text field of the code Drawn %<_FldIdx 0>% by %<_FldIdx 1>% with the two fields as its children. A marker inside a field, as the object of %<\AcObjProp Object(%<_ObjId 2130>%).Area>%, is part of that field's code, kept as written: the library names no object for it (97 of 0 and no 331 written), so that AutoCAD cannot find the object such a field reads, and shows it as one it could not evaluate.

Properties

EvaluatorId

Gets the evaluator of the field (group 1), as AutoCAD's EvaluatorId: _text for a text with fields in it, AcVar for a variable of the drawing, AcObjProp for a property of an object, AcExpr for a formula; empty where the record gives none.

IsTextField

Gets whether the field is a text with fields in it, as AutoCAD's IsTextField: its evaluator _text.

Methods

GetChildren()

Gets the fields of the field, as AutoCAD's GetChildren: those its groups 360 name, in their order, each the field %<_FldIdx>% of its index stands for; null in the place of a handle that names no FIELD of the file, so that each keeps the index its placeholder gives it.

GetFieldCode()

Gets the code of the field (group 2, and the groups 3 that carry it on past 250 characters), as AutoCAD's GetFieldCode(): as the file holds it, a child standing as %<_FldIdx 0>%, the object of a property as %<_ObjIdx 0>%; \AcVar Date \f "dd/MM/yyyy" for a date, Drawn %<_FldIdx 0>% for a text with it in it. Empty where the record gives none.

GetStringValue()

Gets the value AutoCAD kept for the field when it last evaluated it, as AutoCAD's GetStringValue: the text of its cache, the value after 7 ACFD_FIELD_VALUE, as it was shown (302), or, where it has none, its text (1); empty where the field has no value kept, as one made in code.

ToString()

Gives the field as a line for debugging: its type, its handle, its evaluator and its code.