0

I have a problem with revit files loaded into BIM360; Rooms and spaces in Forge viewer are not displayed as in the example reported at the link https://forge.autodesk.com/blog/new-rvt-svf-model-derivative-parameter-generates-additional-content-including-rooms-and-spaces (see picture 1); There is no volume, only one point. Otherwise, if I load revit model into a bucket, following the procedure above, rooms and spaces are represented as desired in the viewer forge (see picture 2). Is there a possibility to call Data Management's APIs (as Model Derivative's APIs, https://forge.autodesk.com/en/docs/model-derivative/v2/reference/http/job-POST/) to load revit file in BIM360 folder by setting generateMasterViews parameter to true? Or is there the possibility in BIM360 to set this option by default for each revit file that is uploaded?

TIA Alder

1 Answers1

0

BIM360 Docs set generateMasterViews to true by default, so no need to do that with BIM360 via Forge Model Derivative API (Not Data Management API).

The viewer of BIM360 is called BIM360 Viewer which is built on the top of the Forge Viewer, but not all features of Forge Viewer are included in BIM360 Viewer. (See BIM 360 Viewer vs Forge Viewer)

Back to your question,

Could you try to load your models that you cannot see the rooms with this viewer code?

var options = {
  env: 'MD20Prod' + (atob(urn.replace('urn:', '').replace('_', '/')).indexOf('emea') > -1 ? 'EU' : 'US'),
  api: 'D3S',
  getAccessToken: getForgeToken
};

if (LMV_VIEWER_VERSION >= '7.48') {
  options.env = 'AutodeskProduction2';
  options.api = 'streamingV2' + (atob(urn.replace('urn:', '').replace('_', '/')).indexOf('emea') > -1 ? '_EU' : '');
}

Autodesk.Viewing.Initializer(options, () => {
  viewer = new Autodesk.Viewing.GuiViewer3D(document.getElementById('forgeViewer'));
  viewer.start();
  var documentId = 'urn:' + urn;
  Autodesk.Viewing.Document.load(documentId, onDocumentLoadSuccess, onDocumentLoadFailure);
});

function onDocumentLoadSuccess(doc) {
  const root = doc.getRoot();
  const viewables = root.search({'type':'geometry', 'role': '3d'});

  console.log('Viewables:', viewables);

  const phaseViews = viewables.filter(v => v.data.name === v.data.phaseNames && v.getViewableRootPath().includes('08f99ae5-b8be-4f8d-881b-128675723c10'));

  console.log('Master Views:', phaseViews);

  viewer.loadDocumentNode(doc, phaseViews[0], { skipHiddenFragments: false }).then(model => {
    // any additional action here?

    console.log({
      'LMV version': LMV_VIEWER_VERSION
    });
  });
}

function onDocumentLoadFailure(viewerErrorCode) {
  console.error('onDocumentLoadFailure() - errorCode:' + viewerErrorCode);
}

ref: https://github.com/yiskang/forge-viewhubmodels-nodejs-svf2/blob/main/public/js/ForgeViewer.js

Eason Kang
  • 6,155
  • 1
  • 7
  • 24