0

当我尝试加载 SVF 模型时,它给我服务器错误 404,虽然模型已上传和翻译,但未能加载资源,它无法找到草图格式的 SVF 文件。它确实适用于其他格式。

模型的骨灰盒:'dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6d3Rfd2hpdGluZ3R1cm5lci83LTEyLTE1JTIwSlNNLnNrcA=='

我用来加载模型的 URL, https://developer.api.autodesk.com/viewingservice/v1/items/urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6d3Rfd2hpdGluZ3R1cm5lci83LTEyLTE1JTIwSlNNLnNrcA==/output/ 1/7-12- 15%20JSM.svf

Sketch文件格式有什么问题吗

查看器 Javascript 代码:options.env = _viewerEnv; // AutodeskProduction、AutodeskStaging 或 AutodeskDevelopment(在此项目的全局变量中设置) options.getAccessToken = getAccessToken; options.refreshToken = getAccessToken;

Autodesk.Viewing.Initializer(options, function() {
    loadDocument(data);   // load first entry by default
});

function loadDocument(urnStr) {

_loadedDocument = null; // reset to null if reloading
_loadedSecondaryDocument = null;

if (!urnStr || (0 === urnStr.length)) {
    alert("You must specify a URN!");
    return;
}
var fullUrnStr = "urn:" + urnStr;

Autodesk.Viewing.Document.load(fullUrnStr, function(document) {
    _loadedDocument = document; // keep this in a global var so we can reference it in other spots

        // get all the 3D and 2D views (but keep in separate arrays so we can differentiate in the UX)
    _views3D = Autodesk.Viewing.Document.getSubItemsWithProperties(document.getRootItem(), {'type':'geometry', 'role':'3d'}, true);
    _views2D = Autodesk.Viewing.Document.getSubItemsWithProperties(document.getRootItem(), {'type':'geometry', 'role':'2d'}, true);

    loadViewMenuOptions();                   // populate UX with views we just retrieved
    initializeViewerMain(mainViewerSelectionChanged);
    initializeViewerSecondary(secondaryViewerSelectionChanged, secondaryViewerGeometryLoaded);

        // load up first 3D view by default into the primary viewer
    if (_views3D.length > 0) {
        loadView(_loadedDocument, _viewerMain, _views3D[0]);
    }
    else {      // there weren't any 3D views!
        if (_views2D.length > 0) {
            loadView(_loadedDocument, _viewerMain, _views2D[0]);
            $('#pu_viewToLoad').val('1000'); // selects first option in 2D list
        }
        else {
            alert("ERROR: No 3D or 2D views found in this drawing!");
        }
    }
        // now load the Secondary viewer with the first 2D view by default
    if (_views2D.length > 0) {
        loadView(_loadedDocument, _viewerSecondary, _views2D[0]);
        $('#pu_viewToLoad').val('1000'); // selects first option in 2D list
    }
    else {
        console.log("WARNING: No 2D views found for secondary view, using additional 3D view");
        if (_views3D.length > 0)
            loadView(_loadedDocument, _viewerSecondary, _views3D[0]);
    }


}, function(errorCode, errorMsg) {
    alert('Load Error: ' + errorCode + " " + errorMsg);
});
}

非常感谢任何帮助。

4

0 回答 0