Table of Contents

Class DxfDBDictionary

Namespace
GeometryHelper.Dxf
Assembly
GeometryHelper.dll

A dictionary of a DXF file, as AutoCAD's DBDictionary: a DICTIONARY of the OBJECTS section, its entries each a name and the object it names, found by name, letters of either case the same, as AutoCAD finds one.

public sealed class DxfDBDictionary : DxfDBObject, IEnumerable<DxfDBDictionaryEntry>, IEnumerable
Inheritance
DxfDBDictionary
Implements
Inherited Members
Extension Methods

Remarks

The extension dictionary an entity is given by CreateExtensionDictionary() is one, reached by ExtensionDictionary: line.ExtensionDictionary.SetAt("GH_DATA", new DxfDBDictionary()) adds a dictionary named GH_DATA to it, owned by it, as AutoCAD writes one: its handle above every handle of the file, its owner as its reactor and its owner (330), the marker AcDbDictionary and its cloning (281 of 1); the entry is written last among those of the owner, its name as a 3 and the new dictionary's handle as a 350, a 360 where the owner owns its entries hard (280 of 1), as an extension dictionary does.

A dictionary holds objects of the library's classes as they come: a DxfDBDictionary, a DxfXrecord, a DxfGroup, a DxfLayout, a DxfPlotSettings, a DxfField, which SetField(DxfField) adds, or a DxfDataLink, read only; the other objects of the OBJECTS section, as a MATERIAL, are read as they are. The drawing's own dictionaries are reached from NamedObjectsDictionary, GroupDictionary, LayoutDictionary and the others of the database.

An entry is taken out of the record when its object is erased, so there are no erased entries to walk: AutoCAD's IncludingErased has nothing to add here.

Constructors

DxfDBDictionary()

Initializes a dictionary made in code, empty, to be added to another by SetAt(string, DxfDBObject), as AutoCAD's DBDictionary() is.

Properties

Count

Gets how many entries the dictionary has, as AutoCAD's Count; nought for one made in code.

this[string]

Gets or sets the object of an entry, as AutoCAD's indexer: GetAt(string) and SetAt(string, DxfDBObject).

TreatElementsAsHard

Gets or sets whether the dictionary owns its entries hard (group 280 of 1), as AutoCAD's TreatElementsAsHard: an extension dictionary does; a hard owner names its entries by groups 360, a soft one by 350. False where the record gives none.

Methods

Contains(DxfDBObject)

Gets whether an entry of the dictionary names an object, as AutoCAD's Contains of an id: by its handle.

Contains(string)

Gets whether the dictionary has an entry of a name, as AutoCAD's Contains, letters of either case the same.

CopyTo(DxfDBDictionaryEntry[], int)

Copies the entries into an array from an index on, as AutoCAD's CopyTo, in the order of the record.

GetAt(string)

Gets the object an entry names, as AutoCAD's GetAt gives its id.

GetEnumerator()

Gets an enumerator over the entries, in the order of the record.

NameAt(DxfDBObject)

Gets the name of the entry that names an object, as AutoCAD's NameAt.

Remove(DxfDBObject)

Takes out the entry that names an object, as AutoCAD's Remove of an id, and erases the object.

Remove(string)

Takes out the entry of a name, as AutoCAD's Remove, and erases the object it names with what that owns, as an object of a DXF file is owned by something.

SetAt(string, DxfDBObject)

Adds an object under a name, as AutoCAD's SetAt: an object made in code written into the file as the dictionary's own, last among its entries, as AutoCAD writes it; where the name has an entry already, the object it named is erased, with what it owns, and the entry names the new one, as AutoCAD replaces it.

SetName(string, string)

Renames an entry, as AutoCAD's SetName; nothing where the name is the one it has. An anonymous group given a name that does not begin with * is anonymous no longer (group 70 of 0), as Name makes it.

ToString()

Gives the dictionary as a line for debugging: its type, its handle and how many entries it has.