---
title: lookAt
slug: viewer-2d/methods/lookAt
docTags: 
createdAt: 2024-02-21T14:33:53.989Z
---

Adjusts the viewbox so that the specified objects are visible.

## Example

::codepen{url="https://codepen.io/Catenda/embed/rNEpeVg"}

## Usage

```javascript
const objectIds = ["object-1", "object-2"];
const options = {
  expand: 10,
  retainStoreys: true
};

viewer2d.lookAt(objectIds, options);
```

## Parameters

### objectIds

Ids of the objects to look at.

| **Type**       | **Required** |
| -------------- | ------------ |
| Array\[String] | Yes          |

### options

Options for adjusting the viewbox.

| **Type** | **Required** |
| -------- | ------------ |
| Object   | No           |

**Properties**

If any of the objects are visible the default value for retainStoreys is `true`, otherwise the default value is `false`.

| **Name**        | **Type**                                          | **Required** | **Description**                                   |
| --------------- | ------------------------------------------------- | ------------ | ------------------------------------------------- |
| `expand`        | Number or [Vector2](docId\:HfHNmbFsrRrISUBE9WgGy) | No           | Expand the view in meters surrounding the objects |
| `retainStoreys` | Boolean                                           | No           | Keep current storeys                              |

