Hide menu
Embedded Viewer

The Embedded Viewer lets you embed 3D viewer of your model on your website.

Limitations

Although Cloud API has special viewer:read scope, which allows get visualization data from server securely, but currently it cannot be really used with embedded viewer. Viewer can display public files only which does not required authentication to access to visualization data.

Note
When file is public, all requests have data:read viewer:read permissions by default.

Prepare model for the viewer

Before display a model in the viewer you should prepare the model to be displayed on your page.

  1. Upload model to CAD Exchanger Cloud using Data management API.
  2. Obtain file identificator of created file.
  3. Wait until the model will be processed successfully (activeRevision should have success status).
  4. Make model public available (anyone who sees the model in embedded viewer should have access to visualization data).
  5. Embed viewer into your web page.

Add viewer to an HTML Page

Define an <iframe> tag in your application in which the src URL specifies the content that the viewer will load as well as any other viewer parameters you want to set. The <iframe> tag's height and width parameters specify the dimensions of the viewer.

<iframe type="text/html"
src="https://cloud.cadexchanger.com/embedded.html?file_id=5b30e131c2c9bc25c09b0d81"
frameborder="0"
width=600
height=400>
</iframe>

Viewer parameters

You can configure your Embedded Viewer to load a specific model and display it using different parameters. Parameters should be added to the IFrame URL as query string.

NameTypeDefault valueDescription
fileIdrequired

String

Specifies CAD Exchanger Cloud identificator of the file that you want to display.

autoPlay

Number

0

Specifies whether the model loading and displaying will automatically start when the viewer loads. When autoPlay=0 model doesn't displays on viewer loads. Instead, the model's thumbnail with "play" button displays. Viewer doesn't load any data required for visualization until the "play" button will be clicked.

autoPlay=1
autoPlay=0
showViewCube

Number

0

Specifies display ViewCube tool or not.

showViewCube=1
showViewCube=0
cameraType

String

isometric

Specifies camera projection type used by viewer camera. Should be one of isometric and perspective.

cameraType=isometric
cameraType=perspective
displayMode

String

auto

Specifies display mode used for model displaying. Should be one of auto, wireframe, shaded, shadedWithBoundaries. auto mode means to use shadedWithBoundaries for BRep representation and shaded otherwise.

displayMode=
wireframe
displayMode=
shaded
displayMode=
shadedWithBoundaries
representation

String

auto

Specifies representation type used for model displaying. Should be one of auto, brep,poly, finePoly, mediumPoly, coarsePoly. auto type means to use BRep representation if available and Poly otherwise. poly type means to use first found polygonal representation.

representation=
brep
representation=
finePoly
representation=
mediumPoly
representation=
coarsePoly
Note
If requested representation is not available for model, nothing will be displayed.
bg

String

null

Specifies background color in css notation.