Skip to content

Commit

Permalink
[BIM-4042] model.getViewpoint and model.setViewpoint (#234)
Browse files Browse the repository at this point in the history
* Document get/setViewpoint

* More general links to BIM Viewpoint
  • Loading branch information
Bates550 authored Apr 18, 2024
1 parent 0d5dd9a commit 6276dff
Showing 1 changed file with 85 additions and 0 deletions.
85 changes: 85 additions & 0 deletions bim_webviewer/bim_web_viewer.md
Original file line number Diff line number Diff line change
Expand Up @@ -3461,6 +3461,77 @@ Promise<void>

Model

### Get Viewpoint

<p class="heading-link-container"><a class="heading-link" href="#get-viewpoint"></a></p>

```js
getViewpoint();
```

#### Description

Gets the current state of the model as a [`Viewpoint`](#viewpoint), which can be used to create a [BIM Viewpoint](https://developers.procore.com/reference/rest/v1/bim-viewpoints)

Includes the following:

- applied sectioning
- camera type and orientation

Will currently always return empty redlines as the Web Viewer does not yet have a way to author them.

#### Parameters

None

##### Returns

```js
Promise<Viewpoint>
```

##### Namespace

Model

---

### Set Viewpoint

<p class="heading-link-container"><a class="heading-link" href="#set-viewpoint"></a></p>

```js
setViewpoint(viewpoint);
```

#### Description

Sets the current state of the model to match the [`Viewpoint`](#viewpoint), which can be gotten from endpoints that return a [BIM Viewpoint](https://developers.procore.com/reference/rest/v1/bim-viewpoints)

Includes the following:

- applied sectioning
- camera type and orientation
- redlines

#### Parameters

| Field Name | Required | Type | Description |
| - | - | - | - |
| `viewpoint` | true | [`Viewpoint`](#viewpoint) | Viewpoint to apply to the model. |

##### Returns

```js
Promise<void>
```

##### Namespace

Model

---

## Markup Namespace

<p class="heading-link-container"><a class="heading-link" href="#markup-namespace"></a></p>
Expand Down Expand Up @@ -4590,6 +4661,20 @@ The one addition we've made is the `unit` field. If the `unit` is not present, w
};
```

### Viewpoint

<p class="heading-link-container">
<a class="heading-link" href="#viewpoint"></a>
</p>

```ts
{
camera_data: string; // JSON string
sections_data: string; // JSON string
redlines_data: string; // JSON string
};
```

### Urls Object

<p class="heading-link-container">
Expand Down

0 comments on commit 6276dff

Please sign in to comment.