You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过Autodesk Viewer API判断IFC转SVF2的转换方式(Legacy/V3)

判断IFC转SVF2的转换方式(Legacy vs V3)

可以通过JS Viewer API直接判断,核心是读取模型转换生成的manifest文件中的元数据,或者利用Viewer实例的内置方法:

  • 方法1:解析模型Manifest元数据
    模型加载完成后,通过viewer.model.getManifest()获取manifest对象,查看其中的转换版本标识:

    viewer.addEventListener(Autodesk.Viewing.GEOMETRY_LOADED_EVENT, () => {
      const manifest = viewer.model.getManifest();
      const metadata = manifest.derivatives?.[0]?.metadata;
      if (metadata?.conversionVersion === 'v3') {
        console.log('模型采用V3转换方式');
      } else if (metadata?.conversionVersion === 'legacy') {
        console.log('模型采用Legacy转换方式');
      } else {
        console.log('无法识别转换方式');
      }
    });
    
  • 方法2:使用Viewer内置判断方法(部分版本支持)
    较新的Viewer版本提供了isV3IFC()方法直接判断,若该方法不存在则回退到解析manifest的方式:

    viewer.addEventListener(Autodesk.Viewing.GEOMETRY_LOADED_EVENT, () => {
      if (typeof viewer.model.isV3IFC === 'function') {
        const isV3 = viewer.model.isV3IFC();
        console.log(isV3 ? 'V3转换方式' : 'Legacy转换方式');
      } else {
        const manifest = viewer.model.getManifest();
        const outputType = manifest.derivatives?.[0]?.outputType;
        console.log(outputType?.includes('ifcV3') ? 'V3转换方式' : 'Legacy转换方式');
      }
    });
    

注意事项:

  • 建议使用v7.xx及以上版本的Viewer,部分API方法在旧版本中可能不支持。
  • 若manifest中无明确conversionVersion字段,可检查engineVersion字段——V3转换对应的引擎版本通常高于Legacy版本。

内容的提问来源于stack exchange,提问作者NoName

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.04 02:12:04