0

I am trying to upload my model using Autodesk Forge. I got all the necessary tokens and URN using Postman. I wrote the code using the instructions, but it gives error #9. I still haven't figured out how to fix it.

I found such a message on the page, I didn't really understand how it works, but if I understood correctly, then this is a message that my requests are being blocked, maybe because of this I get such an error, but I couldn't fix it either I've tried downloading other models, but to no avail I hid my token, but left the string with the URN, because it seems to me that I might somehow incorrectly specify it

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Autodesk Forge Viewer</title>
    <script src="https://developer.api.autodesk.com/modelderivative/v2/viewers/7.54/viewer3D.min.js"></script>
    <style>
        body {
            margin: 0;
            padding: 0;
            overflow: hidden;
        }
        #forgeViewer {
            width: 100%;
            height: 100vh;
            margin: 0;
            padding: 0;
        }
    </style>
</head>
<body>
    <div id="forgeViewer"></div>

    <script>
        var options = {
            env: 'AutodeskProduction',
            api: 'derivativeV2',
            getAccessToken: function(onTokenReady) {
                var accessToken = '<my_token>';
                var expireTimeSeconds = 60 * 30;
                onTokenReady(accessToken, expireTimeSeconds);
            }
        };
        var documentId = 'urn:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bG9yZDYwNi9yYWNhZHZhbmNlZHNhbXBsZXByb2plY3QucnZ0';

        Autodesk.Viewing.Initializer(options, function() {
            var viewer = new Autodesk.Viewing.GuiViewer3D(document.getElementById('forgeViewer'));
            viewer.start();
            Autodesk.Viewing.Document.load(documentId, function(document) {
                var defaultModel = document.getRoot().getDefaultGeometry();
                viewer.loadDocumentNode(document, defaultModel);
            }, function(errorMsg) {
                console.error('Load Error: ' + errorMsg);
            });
        });
    </script>
</body>
</html>    ```
I downloaded an example .rvt model from the autodesk examples website. Yes, I noticed that when executing get manifest, it returns false. I just don't understand why, I moved the model to the Postman/files folder. I checked the box so that it can take files from any source, but it is still false
```    {
    "type": "manifest",
    "hasThumbnail": "false",
    "status": "failed",
    "progress": "complete",
    "region": "US",
    "urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bG9yZDYwNi9yYWNfYWR2YW5jZWRfc2FtcGxlX3Byb2plY3QucnZ0",
    "version": "1.0",
    "derivatives": [
        {
            "name": "LMV Bubble",
            "hasThumbnail": "false",
            "status": "failed",
            "progress": "complete",
            "messages": [
                {
                    "type": "error",
                    "message": "Tr worker fail to unzip.",
                    "code": "TranslationWorker-InternalFailure"
                }
            ],
            "outputType": "svf"
        }
    ]
}    ```
4
  • The above code worked just fine for me to view a model. If you're unable to view the model, please check the manifest(aps.autodesk.com/en/docs/model-derivative/v2/reference/http/…) to make sure the translation is a success. I don't see an upload functionality in your code. Many of our samples have upload functionality. like oss-manager.autodesk.io/# github.com/autodesk-platform-services/aps-simple-viewer-nodejs aps-extensions.autodesk.io etc.. you can reuse the code from these samples. Commented Apr 17, 2024 at 7:01
  • I downloaded an example .rvt model from the autodesk examples website. Yes, I noticed that when executing get manifest, it returns false. I just don't understand why, I moved the model to the Postman/files folder. I checked the box so that it can take files from any source, but it is still false ... "type": "manifest", "hasThumbnail": "false", "status": "failed", "progress": "complete", "region": "US", ... Commented Apr 17, 2024 at 8:29
  • ..."derivatives": [ { "name": "LMV Bubble", "hasThumbnail": "false", "status": "failed", "progress": "complete", "messages": [ { "type": "error", "message": "Tr worker fail to unzip.", "code": "TranslationWorker-InternalFailure" } ... Commented Apr 17, 2024 at 8:31
  • please give me the link to the file, I will test it and let you know. Commented Apr 18, 2024 at 4:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.