Class CadLayerFilters
- Namespace
- OpenCAD2D
- Assembly
- OpenCAD2D.Core.dll
The layer filters of a drawing, read and edited as AutoCAD 2021 keeps them: property filters and group filters nested under All, the three AutoCAD makes (All Used Layers, Unreconciled New Layers, Viewport Overrides) not kept in the drawing. A filter is added, changed, renamed, deleted, made current and given layers, each one undo step; a name that is a sibling's already is refused.
public static class CadLayerFilters
- Inheritance
-
CadLayerFilters
- Inherited Members
Fields
- Dynamic
The filters AutoCAD makes, listed after those the drawing keeps; each tests one property.
Methods
- AddGroup(CadDocument, IReadOnlyList<string>, string, IEnumerable<string>)
Adds a group filter, nested in a filter or at the top, holding the layers named (those the drawing has).
- AddProperty(CadDocument, IReadOnlyList<string>, string, string)
Adds a property filter, nested in a filter or at the top, with an expression of AutoCAD's form.
- All(IEnumerable<CadLayerFilter>)
The filters and every filter nested in them, depth first, in the order they are listed.
- ConvertToGroup(CadDocument, IReadOnlyList<string>)
Turns a property filter into a group filter of the layers it shows now, as AutoCAD's Convert to Group Filter does; the filters nested in it stay in it.
- Delete(CadDocument, IReadOnlyList<string>)
Deletes a filter with the filters nested in it; the layers stay.
- Find(IReadOnlyList<CadLayerFilter>, IReadOnlyList<string>)
Finds a filter by its names from the top, letters of either case the same.
- Passes(CadLayerFilter, DxfLayerTableRecord, CadLayerFilterContext)
Whether a layer passes a filter: the layer has to pass every filter above it and the filter itself, so that a filter nested in Steel by COLOR=="1" shows the red layers of the steel ones. A property filter reads its expression, a group filter its layers.
- PassesDynamic(string, DxfLayerTableRecord, CadLayerFilterContext)
Whether a layer passes one of the filters AutoCAD makes, by its name: All Used Layers, Unreconciled New Layers (none, as the library does not reconcile) and Viewport Overrides.
- Read(DxfDatabase)
Reads the filters of the drawing: those of ACLYDICTIONARY with the filters nested in them, then those only ACAD_LAYERFILTERS keeps (marked IsLegacy, their expression the one of the record's extended data), each level in the order of the names, letters of either case alike.
- Rename(CadDocument, IReadOnlyList<string>, string)
Renames a filter; a name a sibling has already, letters of either case the same, is refused.
- SetCurrent(CadDocument, IReadOnlyList<string>)
Marks the filter the layer list shows as the current one, as AutoCAD does when one is chosen in its tree (group 290 of its XRECORD); none marks All.
- SetExpression(CadDocument, IReadOnlyList<string>, string)
Changes the expression of a property filter.
- SetLayers(CadDocument, IReadOnlyList<string>, IEnumerable<string>, bool)
Gives a group filter layers, as dragging layers onto it or Select Layers does: added to those it has, or in place of them. A layer the drawing does not have is left out.
- Visible(DxfDatabase, IReadOnlyList<string>, bool, DxfViewport)
The names of the layers a filter lists: those that pass it (those that do not where
invert), the filter found by its names from the top, or by the name of one AutoCAD makes. A path that names no filter, and an empty one, is All: every layer.