Filter nodes

async AsyncCogniteClient.three_d.revisions.filter_nodes(
model_id: int,
revision_id: int,
properties: dict[str, dict[str, SequenceNotStr[str]]] | None = None,
limit: int | None = 25,
partitions: int | None = None,
) ThreeDNodeList

List nodes in a revision, filtered by node property values.

Parameters:
  • model_id (int) – Id of the model.

  • revision_id (int) – Id of the revision.

  • properties (dict[str, dict[str, SequenceNotStr[str]]] | None) – Properties for filtering. The object contains one or more category. Each category references one or more properties. Each property is associated with a list of values. For a node to satisfy the filter, it must, for each category/property in the filter, contain the category+property combination with a value that is contained within the corresponding list in the filter.

  • limit (int | None) – Maximum number of nodes to return. Defaults to 25. Set to -1, float(“inf”) or None to return all items.

  • partitions (int | None) – The result is retrieved in this many parts in parallel. Requires sort_by_node_id to be set to true.

Returns:

The list of 3d nodes.

Return type:

ThreeDNodeList

Example

Filter nodes from the hierarchy in the 3d model that have one of the values “AB76”, “AB77” or “AB78” for property PDMS/Area AND that also have one of the values “PIPE”, “BEND” or “PIPESUP” for the property PDMS/Type.

>>> from cognite.client import CogniteClient, AsyncCogniteClient
>>> client = CogniteClient()
>>> # async_client = AsyncCogniteClient()  # another option
>>> res = client.three_d.revisions.filter_nodes(
...     model_id=1,
...     revision_id=1,
...     properties={
...         "PDMS": {
...             "Area": ["AB76", "AB77", "AB78"],
...             "Type": ["PIPE", "BEND", "PIPESUP"],
...         }
...     },
...     limit=10,
... )