无法加载草图SVF文件,[404]

时间:2016-07-18 19:10:58

标签: autodesk-forge autodesk-viewer autodesk-model-derivative

当我尝试加载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

草图文件格式是否有任何问题

查看器Javascript代码: options.env = _viewerEnv; // AutodeskProduction,AutodeskStaging或AutodeskDevelopment(在此项目的global var中设置)     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);
});
}

非常感谢任何帮助。

0 个答案:

没有答案