【发布时间】:2021-03-22 05:59:49
【问题描述】:
我在本地加载可查看的 svf 时遇到问题。我正在加载bubble.json 文件作为我的文档。 (见下文)
function launchViewer(urn) {
var options = {
env: 'Local',
};
console.log(JSON.stringify(options));
Autodesk.Viewing.Initializer(options, () => {
viewer = new Autodesk.Viewing.Private.GuiViewer3D(document.getElementById('forgeViewer'));
viewer.start();
var documentId = "output/bubble.json";
Autodesk.Viewing.Document.load(documentId, onDocumentLoadSuccess, onDocumentLoadFailure);
});
}
我的输出文件夹包含bubble.json 文件和包含svf 内容的文件夹。
当我运行该函数时,我在控制台上收到以下错误
Logger.js:187 Error while processing SVF: {"url":"http://localhost:5500/output/output/1/result.svf","httpStatus":404,"httpStatusText":"Not Found"}
当我查看 json 文件时,它具有以下内容
"urn": "$file$/output/1/result.svf",
所以它似乎指向错误的地方。当我修改json文件时说
"urn": "$file$/1/result.svf",
模型加载得很好。我可以在加载文档之前简单地以编程方式移动文件或修改 json,但我想知道为什么翻译中的默认 json 文件指向错误的位置。
作为参考,我正在使用 Design Automation for Inventor 并按照此开发人员博客文章翻译我的模型。 [https://forge.autodesk.com/blog/speed-viewable-generation-when-using-design-automation-inventor][1]
【问题讨论】:
标签: autodesk-forge autodesk-viewer autodesk-designautomation