0

Specifying BIM 360 file (dwg or rvt) in Design Automation Workitem.

When create a Design Automation Workitem, how can I specify a dwg or rvt file in BIM 360 as the input? and how can I upload the output file back to BIM 360? I just can't find a good sample of this.

What I've done so far: Specify the Workitem file as in postman sample:

{
    "activityId": "xxx.xxx+xxx",
    "arguments": {
        "InputFile": {
            "url": "https://SomeUrl.com/to/download/the/input/max/file",
            "verb": "get"
        },
        "OutputFile": {
            "url": "https://SomeUrl.com/to/upload/the/output/FBX/file",
            "verb": "put"
        }
    }
}

This article shows a sample of how to pass resources with a user login link

{
    "Arguments": {
        "InputArguments": [
            {
                "Resource": "http://120.138.8.50:8080/drawings/1543468882182_FloorPlanSample_Master.dwg",
                "Name": "HostDwg",
                "Headers": [
                    {
                        "Name": "Authorization",
                        "Value": "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=="
                    }
                ]
            }
        ],
        "OutputArguments": [
            {
                "Name": "Result",
                "HttpVerb": "POST"
            }
        ]
    },
    "ActivityId": "PlotToPDF"
}

Solution: the working Workitem will be similar as the following.

{
    "activityId": "{{activityId}}",
    "arguments": {
        "InputFile": 
            {
            "url": "https://developer.api.autodesk.com/oss/v2/buckets/wip.dm.prod/objects/{{input guid name}}.dwg",
            "headers":
                {
                    "Authorization": "Bearer {{b360_token}}"
                },
            "verb": "get"
            },
        "OutputFile": {
            "url": "https://developer.api.autodesk.com/oss/v2/buckets/wip.dm.prod/objects/{{output guid name}}.dwg",
            "headers":
                {
                    "Authorization": "Bearer {{b360_token}}"
                },
            "storageProvider": "A360",
            "verb": "put"
        }
    }
}
Lei
  • 13
  • 4

1 Answers1

0

You can use BIM360 APIs to obtain the URL of a specific document in your BIM360 project. Here's a tutorial that shows how to do that: https://forge.autodesk.com/en/docs/bim360/v1/tutorials/documen-management/download-document. You're correct in that you'd need to pass along an access token.

Alternatively, you might want to consider creating a signed URL to download your BIM360 document from. That's handled by the POST buckets/:bucketKey/objects/:objectName/signed endpoint.

Petr Broz
  • 8,891
  • 2
  • 15
  • 24
  • Link to the endpoint documentation is not valid anymore. I think the new one is this [POST buckets/:bucketKey/objects/:objectKey/signed](https://forge.autodesk.com/en/docs/data/v2/reference/http/buckets-:bucketKey-objects-:objectKey-signed-POST/) – gmad Nov 23 '22 at 17:02