filter <ident> = ( <condition> )
or
filter <ident> = { <condition> ... }
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.
<ident>
The name of the identifier.
<condition>
A condition containing a test on entity element value, one of:
A single condition of the form, <element> <op> <value>.
A combination of conditions enclosed by parentheses and separated by the boolean operators | or ||, & or &&.
Another filter identifier whose conditions are to be copied.
<element>
An entity element name, or one of the special element names all or part. If <element> is an array, an
array range may be specified. This can also be a fully qualified compound/gstructure member name
when filtering on structure attributes.
<op>
One of the simple conditional
operators: = != < <= > >=., or one
of the occurrence or range operators: =| =& <|>
<=|=> etc.
<value>
The right-hand side of the condition.
The type of values will depend on the type of <element>,
e.g. numeric, string, point, time or symbolistic.
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.
None
An empty filter identifier does no filtering, i.e. it selects all entities from the object it is applied to.
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*')
Commands: |
|
Identifiers: |
current_filter (filter) |