Manual Reference Source

Modelo API

Modelo API provides the every bit of functionalities you need to build a BIM platform.

Basic usage

Create a model viewer with default UI.

<!DOCTYPE html>
<html lang="en">

<head>
  <link rel="stylesheet" href="http://api-release.modeloapp.com/prod/modeloapiui-1.0-lts.css" type="text/css" />
  <style type="text/css">
    #modelContainer { width:100%; height:100%; position: absolute; }
  </style>
</head>

<body>
  <div id="modelContainer"></div>
  <script src="http://api-release.modeloapp.com/prod/modeloapi-1.1-lts.js"></script>
  <script src="http://api-release.modeloapp.com/prod/modeloapiui-1.1-lts.js"></script>
  <script>
  window.onload = function() {
       Modelo.init({ endpoint: "https://build-portal.modeloapp.com" });

       var modelId = "wm8vx71L";
       var container = document.querySelector("#modelContainer");
       var appToken = 'c2FtcGxlcyxtb2RlbG9TQU1QTEVT';

       Modelo.Auth.signIn(
           appToken,
           function() {
               const modelApp = new Modelo.WebApp({
                   modelId,
                   containerId: "modelContainer"
               });
           },
           function(e) {
               console.error(e);
           }
       );
   };
  </script>
</body>
</html>