title: Autodesk Forge Viewer : how to get document
body: <p>I am trying to get a list of all the 2d and 3d models that go with a converted rvt file.</p>
  
  <p>Looking at the older <a href="https://github.com/JimAwe/LmvNavTest" rel="nofollow">example : LmvNavTest</a> they do something like this to get access to the "document" rootItem </p>
  
  <pre><code>Autodesk.Viewing.Document.load(fullUrnStr, function(document) {
      _loadedDocument = document; // keep this in a global var so we can reference it in other spots
  
          // get all the 3D and 2D views (but keep in separate arrays so we can differentiate in the UX)
      _views3D = Autodesk.Viewing.Document.getSubItemsWithProperties(document.getRootItem(), {'type':'geometry', 'role':'3d'}, true);
      _views2D = Autodesk.Viewing.Document.getSubItemsWithProperties(document.getRootItem(), {'type':'geometry', 'role':'2d'}, true);
  </code></pre>
  
  <p>From my understanding the prefered way now is to use loadModel</p>
  
  <pre><code>oViewer =new Autodesk.Viewing.Private.GuiViewer3D ($("#viewerContainer") [0], {}) ;
  oViewer.loadModel (url , [],  onLoadSuccess, onLoadFail) ;
  </code></pre>
  
  <p>If i do it the loadModel way how do I get access to the document so that I can call its getSubItemsWithProperties method </p>