简体   繁体   English

在 Autodesk Forge 中无法获取 AEC model 数据

[英]Can not get AEC model Data in Autodesk Forge

i try to activate Revit Levels and 2D Minimap extension in autodesk forge viewer, but can not get AEC Model Data.我尝试在 Autodesk Forge 查看器中激活 Revit Levels 和 2D Minimap 扩展,但无法获取 AEC Model 数据。 I got this worning`我穿了这个`

在此处输入图像描述

i tried to get AEC data with this code我尝试使用此代码获取 AEC 数据

const url = window.location.search;
console.log(url);
const svf_path = `${url.replace("?", "/storage/").replace(/%20/g, " ")}`;

Autodesk.Viewing.endpoint.getItemApi = (endpoint, derivativeUrn, api) => {
  return svf_path;
};

Autodesk.Viewing.Initializer(options, async () => {
  const paths = svf_path.split("/");
  const [dest, svf_dir] = [paths[2], paths[3]];

  const url = `/api/viewer/dest/${dest}/svf/${svf_dir}/manifest`;
  const response = await fetch(url);
  const manifest = await response.json();

  const init_div = document.getElementById("init_div");
  viewer = new Autodesk.Viewing.GuiViewer3D(init_div, config3d);

  const viewerDocument = new Autodesk.Viewing.Document(manifest);
  const viewable = viewerDocument.getRoot().getDefaultGeometry();
  viewer.start();

  await viewerDocument.downloadAecModelData();

  viewer.loadDocumentNode(viewerDocument, viewable)
  .then(function (result) {
    Autodesk.Viewing.Document.getAecModelData(viewable);
  })
});

wats wrong in my code?我的代码有问题吗?

The warning comes from the BubbleNode.prototype.getAecModelData method.警告来自BubbleNode.prototype.getAecModelData方法。 You are not calling it in your code but it's possible that it's being called by the LevelsExtension itself.您没有在代码中调用它,但它可能被LevelsExtension本身调用。 Try configuring the extension so that it doesn't detect the AEC data automatically by passing in { autoDetectAecModelData: false } as the extension options.尝试通过传入{ autoDetectAecModelData: false }作为扩展选项来配置扩展,使其不会自动检测 AEC 数据。

Btw.顺便提一句。 to debug the issue on your side, you can also try getting the non-minified version of viewer3D.js , put a breakpoint to where the warning is being logged, and see the call stack when the breakpoint is hit.要调试您这边的问题,您还可以尝试获取viewer3D.js的非缩小版本,在记录警告的位置放置一个断点,并在遇到断点时查看调用堆栈。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM