翻译ZIP文件时出现问题

时间:2019-04-17 10:22:04

标签: autodesk-forge

尝试管理XREF。创建了一个zip文件并将其上传到存储桶。然后尝试翻译对象

这里是用于翻译文件的代码。

`List<JobPayloadItem> outputs = new List<JobPayloadItem>()
                        {
                            new JobPayloadItem
                            (
                                JobPayloadItem.TypeEnum.Stl, 
                                new List<JobPayloadItem.ViewsEnum>()
                                {                                    JobPayloadItem.ViewsEnum._2d,JobPayloadItem.ViewsEnum._3d},   new JobObjOutputPayloadAdvanced(JobObjOutputPayloadAdvanced.ExportFileStructureEnum.Multiple)                                
)
};
string Base64URN = string.Empty;
Base64URN = Base64Encode(uploadedObj.objectId);
objUrn.urn = Base64URN;
JobPayload job;
if (string.IsNullOrEmpty(null))
job = new JobPayload(new JobPayloadInput(Base64URN,true,DocNo), new JobPayloadOutput(outputs));
else
job = new JobPayload(new JobPayloadInput(Base64URN, true, uploadedObj.objectKey), new JobPayloadOutput(outputs));
DerivativesApi derivative = new DerivativesApi();
derivative.Configuration.AccessToken = oauth.access_token;
dynamic jobPosted = await derivative.TranslateAsync(job);
objUrn.urn = jobPosted.urn;`

翻译文件时发生异常。

at Autodesk.Forge.DerivativesApi.<TranslateAsyncWithHttpInfo>d__10f.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Autodesk.Forge.DerivativesApi.<TranslateAsync>d__105.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at Atom.UI.Controllers.Document.BIMViewerController.<CreateBucketTest>d__20.MoveNext() in E:\Codebase\Atom\2018.3.0.0_BIM_360_KALPATHARU -FORGE\Atom.UI\Controllers\Document\BIMViewerController.cs:line 463

引发异常 {“ diagnostic”:“无法触发此文件的翻译。”}

1 个答案:

答案 0 :(得分:0)

翻译ZIP归档文件时,在归档文件中将模型文件名指定为RootFilenameJobPayloadInput的第3个参数)-查看详细信息here

var job = new JobPayload(new JobPayloadInput(Base64URN, true, "modelFileName.extensionName"), yourJobPayloadOutput);