Getting Started

Use the 2D Viewer API to embed the 2D Viewer in your web applications.

Using jQuery? More information on using jQuery with the 2D Viewer here.

Installation

1. Add the 2D Viewer to your project

Include the 2D Viewer in your HTML file using a script tag, this will add the global bimsync object to the window object.

HTML


2. Provide a container for the 2D Viewer

Create a div element for attaching a 2D Viewer instance to.

HTML


3. Initialize the 2D Viewer API

Set a callback function and then invoke the loadViewer2d method, the 2D Viewer is ready once callback invoked.

JS


4. Create a 2D Viewer instance

Provide the div element and an options object to the constructor method.

JS


5. Interact with the 2D Viewer

Call methods on the 2D Viewer instance to interact with the 2D Viewer.

JS


Usage

HTML


Options

Adjust the default behavior of the 2D Viewer by providing an options object when creating a 2D Viewer instance.

Properties

Name

Type

Default

Description

hoverSpaces

Boolean

false

Whether mouse hover highlights space below the cursor

showViewpoint

Boolean

true

Sets viewpoint visibility

selectColor

String

#a7f555

Sets the CSS color of selected objects



Updated 25 Mar 2024
Did this page help you?