Command: filter

Syntax

filter <ident> = ( <condition> )

        or

filter <ident> = {
    <condition>
    ...
}

Description

Declare (and optionally assign) a filter identifier. Filters are used as additional selection criteria to include or exclude graphic entities with particular attributes during search operations.

Parameters

The special element names all and part may only be used in combination with the range operators (<|>, <=|=> etc.) and are shorthand for all or any part of the 3-D geometry of an entity.

When multiple lines are provided, i.e. within { and }, each line, known as a "condition line", should contain one or more conditions which, when evaluated against a particular entity's members, will yield a boolean value.

A filter is used to select entities from a wider set. When applied only those entities which satisfy the conditions of the filter are selected, i.e. an entity is selected only when the boolean values yielded by all condition lines are true for the particular entity. There is therefore an implicit & operator between condition lines.

Switches

None

Notes

An empty filter identifier does no filtering, i.e. it selects all entities from the object it is applied to.

Examples

Create a new single condition filter. When applied, only entities whose name matches the wild string 'door*' are selected.

filter doors = (name =% 'door*')

Create a new multi-condition filter. All circles and arcs with a maximum radius 200 whose center is within a 3-D box.

filter cen = {
    gtype =| <'circle','arc'>
    radius <= 200
    center <=|=> <(100,100,0),(300,300,200)>
}

An alternative way of defining the previous example.

filter cen = {
    (gtype =| <'circle','arc'>) && (radius <= 200) && \
    (center <=|=> <(100,100,0),(300,300,200)>)
}

Create a filter which is an extension of another, in this case a previously defined filter named doors.

filter doorwins = {
    doors
    name =% 'window*'
}

Create a filter which selects all entities whose geometry (i.e. any point) lies within a distance 1000 of a point myp.

filter clashes = (part <|> myp:1000)

Create a filter which selects by gstructure member value:

filter avenues = (~myatable.street_gt.street_name =% '*ave*')

See Also

Commands:

group

Identifiers:

current_filter (filter)