【问题标题】:Publish and Generating Room Elements For a Revit Model (C4R)为 Revit 模型 (C4R) 发布和生成房间图元
【发布时间】:2021-12-11 15:32:19
【问题描述】:

我正在开发数据可视化 forge API,以将精灵传感器添加到一些 rooms (architecture model) / spaces (Mep model)。一般来说,我使用Data Management API 发布,但我想知道这是否是一种使用相同 API 包含房间元素/空间元素的方法......

因为documentation 似乎只适用于非 C4R 模型

提前谢谢你

【问题讨论】:

    标签: autodesk-forge autodesk


    【解决方案1】:

    发布到 BIM360 Docs 的 Revit 模型将默认翻译主视图。因此,您无需按照说明请求母校翻译。请记住在 Forge Viewer 中加载主查看器。

    GET :urn/manifest 的响应中,有一个名为isMasterView 的新属性可帮助识别视图是否为 Revit 主视图。

    {
        "isMasterView": true,
        "phaseNames": "Working Drawings",
        "role": "3d",
        "hasThumbnail": "true",
        "children": [
            {
                "guid": "c884ae1b-61e7-4f9d-0001-719e20b22d0b-0010beed",
                "type": "view",
                "role": "3d",
                "name": "Working Drawings",
                "status": "success",
                "progress": "complete",
                "camera": [
                    124.7886734008789,
                    -152.5997772216797,
                    133.87307739257812,
                    7.490562438964844,
                    -35.301666259765625,
                    16.574966430664062,
                    -0.40824830532073975,
                    0.40824830532073975,
                    0.8164966106414795,
                    1.285019040107727,
                    0,
                    1,
                    1
                ]
            },
    //...
            {
                "role": "graphics",
                "mime": "application/autodesk-svf2",
                "guid": "18474dc1-df69-767f-47ee-33e5eac5599d",
                "type": "resource"
            }
        ],
        "name": "Working Drawings",
        "guid": "e4baebbb-4ad6-8223-7f6a-cad4f0bb353a",
        "progress": "complete",
        "type": "geometry",
        "viewableID": "c884ae1b-61e7-4f9d-0001-719e20b22d0b-0010beed",
        "status": "success"
    },
    

    在 Forge Viewer 中,我们可以执行以下操作来加载主视图。

    const root = viewerDocument.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);
    
    const defaultModel = phaseViews[0];
    
    viewer.loadDocumentNode(viewerDocument, defaultModel);
    

    【讨论】:

      猜你喜欢
      • 2019-07-02
      • 1970-01-01
      • 2020-10-22
      • 1970-01-01
      • 2012-01-13
      • 2019-01-07
      • 2021-01-24
      • 2020-08-19
      • 1970-01-01
      相关资源
      最近更新 更多