ItemsFinder
Manages and executes queries to find items within models based on specified criteria. This class provides functionalities to create, store, and execute FinderQuery instances, allowing for efficient retrieval of items that match given query parameters. 📕 Tutorial. 📘 API.
Extends
Implements
Serializable<SerializedFinderQuery>
Properties
enabled
enabled:
boolean=true
Overrides
list
readonlylist:DataMap<string,FinderQuery>
A map of FinderQuery objects, indexed by a string key.
uuid
staticreadonlyuuid:"0da7ad77-f734-42ca-942f-a074adfd1e3a"
A unique identifier for the component. This UUID is used to register the component within the Components system.
Methods
addFromCategories()
addFromCategories(
modelIds?):Promise<string[]>
Adds queries based on categories from items that have geometry.
Parameters
| Parameter | Type | Description |
|---|---|---|
modelIds? | RegExp[] | An optional array of model IDs to filter fragments. If not provided, all fragments are processed. |
Returns
Promise<string[]>
An array with the categories used to create the queries
create()
create(
name,queries):FinderQuery
Creates a new FinderQuery instance and adds it to the list of queries.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | The name of the query. |
queries | ItemsQueryParams[] | The queries to use. |
Returns
The newly created FinderQuery instance.
export()
export():
object
Serializes the ItemsFinder's data into a format suitable for export.
Returns
object
An object containing an array of serialized finder queries.
data
data:
SerializedFinderQuery[]
Implementation of
Serializable.export
getItems()
getItems(
queries,config?):Promise<ModelIdMap>
Retrieves items from specified models based on a query.
Parameters
| Parameter | Type | Description |
|---|---|---|
queries | ItemsQueryParams[] | The query parameters to filter items. |
config? | object | - |
config.aggregation? | QueryResultAggregation | - |
config.modelIds? | RegExp[] | - |
Returns
Promise <ModelIdMap>
A map of model IDs to sets of item IDs that match the query.
import()
import(
result):FinderQuery[]
Imports a list of FinderQuery instances from a SerializationResult containing serialized finder query data.
Parameters
| Parameter | Type | Description |
|---|---|---|
result | SerializationResult <SerializedFinderQuery, Record<string, any>> | The SerializationResult containing the serialized SerializedFinderQuery data. |
Returns
An array of FinderQuery instances created from the serialized data. Returns an empty array if the input data is null or undefined.
Implementation of
Serializable.import
isConfigurable()
isConfigurable():
this is Configurable<any, any>
Whether is component is Configurable.
Returns
this is Configurable<any, any>
Inherited from
isDisposeable()
isDisposeable():
this is Disposable
Whether is component is Disposable.
Returns
this is Disposable
Inherited from
isHideable()
isHideable():
this is Hideable
Whether is component is Hideable.
Returns
this is Hideable
Inherited from
isResizeable()
isResizeable():
this is Resizeable
Whether is component is Resizeable.
Returns
this is Resizeable
Inherited from
isUpdateable()
isUpdateable():
this is Updateable
Whether is component is Updateable.
Returns
this is Updateable