【问题标题】:generateMasterViews in BIM360在 BIM 360 中生成主视图
【发布时间】:2022-01-03 17:25:04
【问题描述】:

我在将 revit 文件加载到 BIM360 时遇到问题; Forge 查看器中的房间和空间未显示为链接https://forge.autodesk.com/blog/new-rvt-svf-model-derivative-parameter-generates-additional-content-including-rooms-and-spaces 中报告的示例(请参阅);没有量,只有一点。 否则,如果我将 revit 模型加载到存储桶中,按照上述过程,房间和空间会在查看器中根据需要表示(请参阅)。 是否可以通过将 generateMasterViews 参数设置为 true 来调用 Data Management 的 API(作为模型衍生的 API,https://forge.autodesk.com/en/docs/model-derivative/v2/reference/http/job-POST/)以在 BIM360 文件夹中加载 revit 文件? 或者在 BIM360 中是否有可能为每个上传的 revit 文件默认设置此选项?

TIA 桤木

【问题讨论】:

    标签: autodesk-model-derivative autodesk-data-management


    【解决方案1】:

    BIM360 Docs 默认将generateMasterViews 设置为true,因此无需通过 Forge Model Derivative API(不是数据管理 API)对 BIM360 执行此操作。

    BIM360 的查看器称为 BIM360 Viewer,它构建在 Forge Viewer 之上,但并非 Forge Viewer 的所有功能都包含在 BIM360 Viewer 中。 (见BIM 360 Viewer vs Forge Viewer

    回到你的问题,

    您能否尝试使用此查看器代码加载您看不到房间的模型?

    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);
    }
    

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

    【讨论】:

    • 谢谢 Eason,使用您的查看器代码它可以工作 :-) 也适用于 BIM360 模型 ;-)
    猜你喜欢
    • 2021-02-28
    • 2021-03-13
    • 2020-05-15
    • 2021-03-31
    • 2019-08-27
    • 2018-07-02
    • 2019-05-09
    • 2018-04-01
    • 2021-10-08
    相关资源
    最近更新 更多