0

我的Forge Design Automation API脚本将产生一些输出,例如 dxf、png、PDF。我可以使用 WorkItem 将它们打包到一个 zip 中吗?下面是我创建的 WorkItem 的代码片段。它会失败,因为在默认情况下,它只能下载单一格式的输出。

var wi = new WorkItem()
{
   Id = "", // Must be set to empty
   Arguments = new Arguments(),
   ActivityId = activity.Id
};

wi.Arguments.InputArguments.Add(new Argument()
{
  Name = "HostDwg", // Must match the input parameter in activity
  Resource =
     "http://download.autodesk.com/us/support/files/autocad_2015_templates/acad.dwt",
  StorageProvider = StorageProvider.Generic // Generic HTTP download (vs A360)
});

wi.Arguments.OutputArguments.Add(new Argument()
{
  Name = "Results", // Must match the output parameter in activity
  StorageProvider = StorageProvider.Generic, // Generic HTTP upload (vs A360)
  HttpVerb = HttpVerbType.POST, // Use HTTP POST when delivering result
  Resource = null, // Use storage provided by Design Automation     
});
4

1 回答 1

1

WorkItem 的 OutputArguments 允许您将结果导出到 zip。ResourceKind = ResourceKind.ZipPackage。例如

wi.Arguments.OutputArguments.Add(new Argument(
{
    Name = "Results", // Must match the output parameter in activity
    StorageProvider = StorageProvider.Generic, // Generic HTTP upload (vs A360)
    HttpVerb = HttpVerbType.POST, // Use HTTP POST when delivering result
    Resource = null, // Use storage provided by Design Automation   
    ResourceKind = ResourceKind.ZipPackage // Upload as zip to output directory  
});

此链接是 WorkItem 的元数据

于 2016-07-13T14:30:29.937 回答