Table of Contents

Class DxfLayerStateManager

Namespace
GeometryHelper.Dxf
Assembly
GeometryHelper.dll

The layer states of a drawing, as AutoCAD's LayerStateManager lists them: the XRECORDs of the dictionary ACAD_LAYERSTATES in the extension dictionary of the layer table, one for each state, named by its entry. Reached by LayerStateManager.

public sealed class DxfLayerStateManager
Inheritance
DxfLayerStateManager
Inherited Members

Remarks

A drawing AutoCAD saved with the states Plan and Sections gives GetLayerStateNames() as Plan and Sections, and HasLayerState("plan") true, letters of either case the same as AutoCAD finds a state; each state's record is LayerStatesDictionary.GetAt("Plan"), a DxfXrecord whose Data are its groups as the file holds them.

The states are read and listed, not saved, restored, renamed or taken apart. AutoCAD 2021 writes a state's XRECORD as its mask (91), its description (301), 290 and 302, then each layer: its handle (330), or its name (8) for a state of an xref or one imported from a .las file, then its flags (90), colour (62), lineweight (370), linetype (331) and plot style (1), and 440; the mask's flag 0x8000 marks a state hidden. Only the names and those two marks are read here: AutoCAD's SaveLayerState, RestoreLayerState, RenameLayerState, DeleteLayerState, GetLayerStateLayers, GetLayerStateMask and GetLayerStateDescription are not here.

Properties

LayerStatesDictionary

Gets the dictionary of the layer states, as AutoCAD's LayerStatesDictionaryId names it: the DICTIONARY the layer table's extension dictionary names ACAD_LAYERSTATES; null where the drawing has none, as a drawing no state was saved in.

Methods

GetLayerStateNames()

Gets the names of the layer states, as AutoCAD's GetLayerStateNames(true, true): the entries of the dictionary of the layer states, in the order of the record, every one, hidden or of an xref.

GetLayerStateNames(bool, bool)

Gets the names of the layer states, as AutoCAD's GetLayerStateNames: the entries of the dictionary of the layer states, in the order of the record, a hidden state only where includeHidden says and the state of an xref only where includeXref says. A state is hidden where flag 0x8000 of the mask of its XRECORD (group 91) is set, as AutoCAD 2021 saves one of the mask 0x8001; it is of an xref where its name joins the xref's and the state's by __ and its XRECORD names every layer by name (group 8), none by handle (330), each a layer of an xref, xref|layer, as AutoCAD keeps the state of an attached xref (70-b-xref-source__GH_XR_STATE, of the layer 70-b-xref-source|XR_WALLS). Layers by name alone do not make a state an xref's: AutoCAD 2021 writes a state it imports from a .las file so, XR_DOORS, 0, and lists it with the drawing's own. A drawing AutoCAD saved with the states GH_PLAN and GH_NOTES_OFF and the hidden GH_HIDDEN gives the two for (false, false) and all three for (true, false).

HasLayerState(string)

Gets whether the drawing has a layer state of a name, as AutoCAD's HasLayerState, letters of either case the same.

ToString()

Gives the manager as a line for debugging: how many layer states the drawing has.