简体   繁体   中英

Is there a way to copy an object from a bucket to the Revit Design Automation local path?

I have created a bucket like following (Python):

payload = {'bucketKey': bucketname,'policyKey': 'transient'}

resp = requests.post(Forge_BASE_URL+'/oss/v2/buckets', headers={'Authorization': config.token,'Content-Type':'application/json'},json=payload)

And then uploaded a file to the bucket created:

url = 'https://developer.api.autodesk.com/oss/v2/buckets/'+bucketname+'/objects/'+encodedfilename

resp = requests.put(url, headers={'Authorization': config.token,'Content-Type': 'application/octet-stream','Content-Length': str(filesize)},data= open(modelfilePath + filename, 'rb'))

How can I download the object from the bucket to the local path of the Revit Design Automation engine? The local path of the Revit Design Automation engine looks like T:\Aces\Jobs\job_id that is used in C# codes.

Either curl command or Python codes are appreciated.

It is actually the responsibility of the Design Automation service to download all the inputs from provided (readable) URLs, run your activity in a secured, sandboxed environment, and then upload all the outputs to provided (writable) URLs.

If your input file is in a Forge Data Management bucket, you could get a temporary signed URL for it, and use that as the URL for the activity input. You can also create writable signed URLs that the Design Automation activity can then upload the results to. See this blog post for more details.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM