> For the complete documentation index, see [llms.txt](https://stage-precision.gitbook.io/grid/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stage-precision.gitbook.io/grid/scripting/api-reference/object-apis/entities.md).

# Entities

### Accessing an Object's Entities

The Entity tree is available through:

```
Object → Entities → Data → Value
```

In Python, the general access pattern is:

```python
sp.<ObjectID>.entities.data.value
```

For example:

```python
entities = sp.Camera1.entities.data.value
```

The returned value is an:

```
sp.ValueTree
```

The same access pattern can be used with different Object types:

```python
cameraEntities = sp.Camera1.entities.data.value
trackerEntities = sp.Tracker1.entities.data.value
dataTreeEntities = sp.DataTree1.entities.data.value
```

### Access Structure

The individual parts of the address represent different scripting handles:

```python
sp.Camera1.entities
```

returns the **Entities Container** as an:

```
sp.ControllableContainer
```

```python
sp.Camera1.entities.data
```

returns the **Data Parameter** as an:

```
sp.Controllable
```

and:

```python
sp.Camera1.entities.data.value
```

returns the actual Entity tree as an:

```
sp.ValueTree
```

### Working with Entity Data

Once the Entity tree has been retrieved, it can be handled using the normal `sp.ValueTree` API.

For example:

```python
entities = sp.Camera1.entities.data.value

value = entities["Status/Temperature"].value
```

Values can also be written through the ValueTree:

```python
entities = sp.Camera1.entities.data.value

entities["Status/Temperature"].value = 42.5
```

The exact Entity structure depends on the Object and the runtime data it exposes.

{% hint style="info" %}
Entity paths and available values are Object-specific. Retrieve the Object's Entity tree first, then use the **ValueTree API** to navigate, read, modify or iterate through its data.
{% endhint %}

### ValueTree API

The Entity tree itself is an `sp.ValueTree`.

See **ValueTree API** for reference information about:

* path access
* `.value`
* `getSubPath()`
* child iteration
* `getType()` and `getParent()`
* removing and moving children
* merging trees
* XML export
