【问题标题】:Autodesk Forge design automationAutodesk Forge 设计自动化
【发布时间】:2021-01-06 11:28:01
【问题描述】:

我正在尝试重新创建 forge-customproperty-revit

我正在访问 A360 上的模型,查看器加载了所选模型,然后一分钟后出现此错误:

Exception has occurred: CLR/Autodesk.Forge.Client.ApiException
An exception of type 'Autodesk.Forge.Client.ApiException' occurred in System.Private.CoreLib.dll but was not handled in user code: 'Error calling CreateSignedResource: {"reason":"Object not found"}'
   at Autodesk.Forge.ObjectsApi.<CreateSignedResourceAsyncWithHttpInfo>d__21.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at forgeSample.Controllers.DesignAutomationController.<>c__DisplayClass4_0.<<OnReadyExtractStyles>b__0>d.MoveNext() in /home/luka/Documents/Coding/NetCore/forge-customproperty-revit/webapp/Controllers/DesignAutomationController.cs:line 79

DesignAutomationController.cs 第 79 行发生异常:

dynamic signedUrl = await bjects.CreateSignedResourceAsyncWithHttpInfo(Utils.BucketName, fileName, new PostBucketsSigned(10), "read");

总的来说,我对 Forge 和 Web API 还是很陌生,所以我什至无法猜测问题出在哪里。

谢谢,

卢卡

【问题讨论】:

    标签: c# autodesk-forge autodesk-viewer autodesk-designautomation


    【解决方案1】:

    除了 Petr Broz 提到的内容之外,DesignAutomationController#79 在未创建输出文件时失败,在这种情况下,这意味着设计自动化工作项没有生成 result.json。请分享 reportUrl 输出,以便我们了解 Revit 失败的原因。

    【讨论】:

      【解决方案2】:

      失败的那一行基本上是尝试生成一个临时的只读 URL,指向 Forge 数据管理中的一个文件(以便以后可以从该 URL 下载该文件)。该方法调用的底层网络请求返回非标准(非200)错误码,可能有多种原因,例如:

      • Utils.BucketName 不包含有效的存储桶名称,或者存储桶不存在
      • fileName 不包含有效的文件名,或者该文件不存在
      • 您的访问令牌无权访问特定存储桶

      我建议将方法调用包装到它自己的try-catch 块中,并输出它可能抛出的任何异常。错误消息应提供更多详细信息。

      【讨论】:

        猜你喜欢
        • 2017-09-08
        • 2018-04-01
        • 2020-04-25
        • 2021-05-24
        • 2018-10-08
        • 2017-12-16
        • 1970-01-01
        • 2021-03-13
        • 2017-09-15
        相关资源
        最近更新 更多