List nodes

async AsyncCogniteClient.three_d.revisions.list_nodes(
model_id: int,
revision_id: int,
node_id: int | None = None,
depth: int | None = None,
sort_by_node_id: bool = False,
partitions: int | None = None,
limit: int | None = 25,
) ThreeDNodeList

Retrieves a list of nodes from the hierarchy in the 3D Model.

You can also request a specific subtree with the ‘nodeId’ query parameter and limit the depth of the resulting subtree with the ‘depth’ query parameter.

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

  • revision_id (int) – Id of the revision.

  • node_id (int | None) – ID of the root node of the subtree you request (default is the root node).

  • depth (int | None) – Get sub nodes up to this many levels below the specified node. Depth 0 is the root node.

  • sort_by_node_id (bool) – Returns the nodes in nodeId order.

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

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

Returns:

The list of 3d nodes.

Return type:

ThreeDNodeList

Example

List nodes from the hierarchy in the 3d model:

>>> from cognite.client import CogniteClient, AsyncCogniteClient
>>> client = CogniteClient()
>>> # async_client = AsyncCogniteClient()  # another option
>>> res = client.three_d.revisions.list_nodes(model_id=1, revision_id=1, limit=10)