1

i'm trying to recreate forge-customproperty-revit.

I'm accessing a model on A360 and the viewer loads for the selected model, and then after a minute this error appears:

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

Exception occurs on DesignAutomationController.cs line 79 :

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

I'm still pretty new to Forge and web API in general, so I can't even start to guess what's the problem.

Thanks,

Luka

Jeremy
  • 357
  • 1
  • 6
Luka
  • 51
  • 3

2 Answers2

1

The line that's failing is basically trying to generate a temporary, read-only URL pointing to one of your files in the Forge Data Management (so that the file could later be downloaded from this URL). The underlying web request called by this method returns non-standard (non-200) error code, and it could be for various reasons, for example:

  • the Utils.BucketName does not contain a valid bucket name, or the bucket does not exist
  • the fileName does not contain a valid file name, or the file does not exist
  • your access token does not have authorization to access the specific bucket

I would recommend wrapping the method call into its own try-catch block and output any exceptions it may throw. The error message should provide more details.

Petr Broz
  • 8,891
  • 2
  • 15
  • 24
1

Adding to what Petr Broz mentioned, DesignAutomationController#79 fails when the output file was not created, in this case, it means that the Design Automation Workitem did not generate the result.json. Please share the reportUrl output so we can understand why Revit is failing.

Augusto Goncalves
  • 8,493
  • 2
  • 17
  • 44