提问者:小点点

问题启动本地锻造查看器,而不是通过设计自动化/OSS


我首先告诉查看器使用指定为气泡的文档启动。json文件:

Helpers.launchViewer('viewerDiv', 'urn:' +  '/resources/41bbc339-294e-4eb1-b5ee-f4f303df46bbviewable/bubble.json');//this.props.modelPath);





function launchViewer(div, urn) {
    getToken.accessToken.then((token) => {
        var options = {
            'document': urn,
            'env': 'Local',
          };

          Autodesk.Viewing.Initializer(options, () => {
            viewer = new Autodesk.Viewing.GuiViewer3D(document.getElementById(div));
            viewer.start(options.document, options);
            Autodesk.Viewing.Document.load(urn, options, onDocumentLoadSuccess, onDocumentLoadFailure);
            viewer.loadExtension('Autodesk.ModelStructure');
          });
    });
}

然后我得到以下错误:

Xhr。js:940邮政编码http://localhost:3000/oss-ext/v2/acmsessions 404(未找到)

Otg。js:198 Uncaught TypeError:无法在Otg读取null的属性“manifest”。js:198at函数。(Otg.js:143)在XMLHttpRequest的l(Xhr.js:564)处。u(Xhr.js:668)

我想知道当我从服务器返回文件时,是否有我不需要的信息,或者我是否做了其他不正确的事情。谢谢!

编辑:我还尝试加载结果。svf而不是气泡,并得到以下错误:

处理SVF时出错:{"url":"/派生服务/v2/衍生物/urn:资源/0d3f37ff-d195451b-9a3c-35402f326f4dviewable/输出/1/result.svf","异常":"同步错误:未能在'XMLHttpRequest'上执行'open':无效的URL","堆栈":"错误:未能在'上执行'open'_rawGet(blob:http://localhost:3000/a2115ade-285d-4398-8b8b-ae7704e9cc25: 1:60485)\n at blob:http://localhost:3000/a2115ade-285d-4398-8b8b-ae7704e9cc25: 1:59206\n at n...


共2个答案

匿名用户

我自己解决了这个问题-Autodesk文档指定加载文档时“urn:”必须位于urn之前。在本地加载文档时,应使用不带“urn:”词缀的相对文件路径。

匿名用户

  1. 您不需要在脱机查看器中添加urn前缀

如需更多信息,请检查此问题。