Skip to content

SelectionQuery

Canonical path: NemAll_Python_IFW_Input.SelectionQuery

Class containing checking procedures to obtain, whether an element is valid for being selected during element selection.

Methods:

  • Clear

    Clear the query

  • IsEmpty

    Check for an empty query

  • __init__

    dummy, is only needed for the creation of the documentation by MkDocs

Clear

Clear()

Clear the query

IsEmpty

IsEmpty() -> bool

Check for an empty query

Returns:

  • bool

    Filter is empty: true/false

__init__ overloaded

__init__()

Construct empty query. All elements are considered valid for selection

__init__(query: SelectionQuery)

Copy constructor

Parameters:

__init__(query: list[QueryTypeID | object] | QueryTypeID | object)

Default constructor

Parameters:

  • query (list[QueryTypeID | object] | QueryTypeID | object) –

    Selection query as list with queries or single query.

Examples:

The query can be a list of QueryTypeID like this:

>>> type_uuids = [AllplanIFW.QueryTypeID(AllplanElementAdapter.Beam_TypeUUID),
...               AllplanIFW.QueryTypeID(AllplanElementAdapter.Column_TypeUUID)]
... selection_query = AllplanIFW.SelectionQuery(type_uuids)

or a class with a call member, like this:

>>> class CustomFilter():
...     def __call__(self, element: AllplanElementAdapter.BaseElementAdapter) -> bool:
...         return isinstance(element.GetModelGeometry(), AllplanGeometry.Polyhedron3D):
... selection_query = AllplanIFW.SelectionQuery([CustomFilter()])