Table of Contents

Class CadSelectionFilter

Namespace
OpenCAD2D
Assembly
OpenCAD2D.Core.dll

An object selection filter, as AutoCAD's FILTER makes one: a list of lines, which an object has to pass all of, except where lines are grouped with AND, OR, XOR and NOT (a group may hold groups, ten deep at most); named lists kept for the session, the current one *unnamed, and written to and read from the file AutoCAD keeps them in, filter.nfl. Of a plan with 312 lines on WALLS and 40 circles there, Object = Line and Layer = WALLS pass the 312, and Object = Circle with a NOT group round Circle Radius >= 1 passes the circles under 1 in radius.

public sealed class CadSelectionFilter
Inheritance
CadSelectionFilter
Inherited Members

Fields

Unnamed

The name of the list being edited where it has no name of its own, as AutoCAD's.

Properties

Choices

Gets the items of the Select Filter list of AutoCAD 2021's dialog, in its order: the properties to test, the kinds of object (Arc, Line, Block) that make an Object line, and the begin and end of each group.

CurrentName

Gets or sets the name of the current list: Unnamed, or one saved.

FilePath

Gets or sets the file the named lists are kept in, AutoCAD's filter.nfl form: written whenever a list is saved or deleted, and read by Reload(); null keeps them for the session only.

Lines

Gets the lines of the current list, in the order they were added.

Names

Gets the names of the lists saved, Unnamed first, the others in alphabetical order, capitals and small letters alike ("alpha" before "Beta").

Methods

Apply(CadDocument, IEnumerable<string>)

Gets the objects of a list that pass, in the order given; handles the document has no entity of are passed over.

DeleteCurrent()

Deletes the current list where it has a name, as Delete Current Filter List; Unnamed is refused.

KindsIn(CadDocument)

Gets the kinds of the objects of a drawing, as an Object line names them (Line, Circle, MText), in ordinal order.

LinesOf(DxfEntity)

Gets the lines Add Selected Object adds for an entity, as AutoCAD's: its kind, layer, colour and linetype, then what belongs to its kind, as an arc's centre and radius or a text's position, words, style, height and rotation.

LoadNfl(string)

Reads named lists from the text of a filter.nfl file, in place of the named lists held; a list that does not read leaves them all as they were.

Passes(DxfEntity)

Gets whether an entity passes the lines of the list: every one outside a group, and each group as it says.

Reload()

Reads the named lists from FilePath, as AutoCAD's FILTER does each time it starts; nothing happens where no file is set or none is there.

Restore(string)

Makes a list saved the current one, its lines copied into Lines; Unnamed keeps the lines there.

SaveAs(string)

Saves the current list under a name, replacing a list of that name, and makes the name current.

ToNfl()

Writes the named lists as AutoCAD's FILTER keeps them in filter.nfl: the line "Filter.nfl -- Do not edit this file.", then for each list :ai_lisp|NAME with its tests as the lists of an AutoLISP ssget filter ((8 . "WALLS"), (-4 . ">=") with (40 . 15.0), (-4 . "<NOT")) and :ai_str|NAME with the lines as the dialog lists them, tab between the columns. *unnamed is not kept.

TransparenciesIn(CadDocument)

Gets the transparencies Select... lists for a Transparency line: ByLayer, ByBlock, then the per cents the objects of the drawing have, least first.

Validate()

Checks the groups of the lines as AutoCAD checks them when the filter is applied: each Begin has its End, nothing is empty, XOR has two operands and NOT one.

Validate(IReadOnlyList<CadFilterLine>)

Checks the groups of lines as Validate() does, for lines not yet given to the filter.