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

Loads a model from a URL.

:::hint{type="info"}
By default removes existing models before loading the new model.
:::

## Example

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

## Usage

```javascript
const options = {
  append: true,
  modelId: "my-model-id",
  modelName: "My Model Name"
};
const url = "https://api.catenda.com/v2/projects/{PROJECT_ID}/viewer2d/geometry?token=YOUR_TOKEN";

const modelInfosPromise = viewer2d.loadUrl(url, options);
```

## Parameters

### url

URL to the model.

| **Type** | **Required** |
| -------- | ------------ |
| String   | Yes          |

### options

Options for loading the model.

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

**Properties**

| **Name**    | **Type** | **Required** | **Description**                         |
| ----------- | -------- | ------------ | --------------------------------------- |
| `append`    | Boolean  | No           | Append model to existing loaded models  |
| `modelId`   | String   | No           | User provided id for the loaded model   |
| `modelName` | String   | No           | User provided name for the loaded model |

## Return Value

Promise that resolves to a list of model information for the loaded models.

| **Type**                   |
| -------------------------- |
| `Promise => Array[Object]` |

**modelInfo**

| **Name**      | **Type**                             | **Description**                  |
| ------------- | ------------------------------------ | -------------------------------- |
| `id`          | String                               | Id of the loaded model           |
| `boundingBox` | [Box3](docId\:jFfhx6zgBAmWXgmvf_z-r) | Bounding box of the loaded model |

