Access bim 360 file using design automation

你。 提交于 2021-02-11 14:34:15

问题


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"
        }
    }
}

回答1:


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.



来源:https://stackoverflow.com/questions/54413123/access-bim-360-file-using-design-automation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!