【问题标题】:Is there a way to copy an object from a bucket to the Revit Design Automation local path?有没有办法将对象从存储桶复制到 Revit Design Automation 本地路径?
【发布时间】:2021-12-28 22:44:28
【问题描述】:

我创建了一个如下所示的存储桶(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)

然后将文件上传到创建的bucket中:

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'))

如何将存储桶中的对象下载到 Revit Design Automation 引擎的本地路径? Revit Design Automation 引擎的本地路径类似于 C# 代码中使用的 T:\Aces\Jobs\job_id

感谢curl 命令或 Python 代码。

【问题讨论】:

    标签: autodesk-forge autodesk-data-management


    【解决方案1】:

    实际上,Design Automation 服务负责从提供的(可读)URL 下载所有输入,在安全的沙盒环境中运行您的活动,然后将所有输出上传到提供的(可写)URL。

    如果您的输入文件位于 Forge 数据管理存储桶中,您可以为其获取一个临时的 signed URL,并将其用作活动输入的 URL。您还可以创建 可写 签名的 URL,然后设计自动化活动可以将结果上传到该 URL。有关详细信息,请参阅此blog post

    【讨论】:

      猜你喜欢
      • 2019-07-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-07
      • 2019-03-26
      • 2020-01-23
      • 2019-09-28
      • 1970-01-01
      相关资源
      最近更新 更多